Posts

Showing posts with the label second highest number in array

How to find second highest number in array by c programming

Image
How to find second highest number in array by c programming if you are using turbo c compiler please use  #include<conio.h> header file. and if you are using devc++ or any other compiler than simply go through the given program below. #include <stdio.h> int main(){          char a[20],i,n,temp;     printf("enter size of array\n");     scanf("%d",&n);     printf("enter elements of array\n");     for(i=0;i<n;i++){        scanf("%d",&a[i]);               }          for(i=0;i<n;i++){                  if(a[i]>a[0])         {            temp=a[0];             a[0]=a[i];            a[i]=temp;   ...