C Program to Find the Biggest and Smallest Number from the given Numbers using Array

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[10],n,i,big,small;
 clrscr();
 printf("Enter the total number of values:");
scanf("%d",&n);
 for(i=0;i<n;i++)
 {
 printf("\nEnter a[%d]=",i);
 scanf("%d",&a[i]);
 }
  big=a[0];
  small=a[0];
  for(i=1;i<n;i++)
   {
     if(big<a[i])
      big=a[i];
     if(small>a[i])
      small=a[i];
   }
 printf("\nBiggest Number is %d\nSmallest Number is %d",big,small);
 getch();
}
Previous
Next Post »

If you still didn't find what you're looking for, you can search this website below: