Saturday, February 23, 2013

C Program To Find Out Smallest Number In An Array.

#include<stdio.h>
#include<conio.h>
void main ()
{
int ar[100],n,i,small;
clrscr ();
printf("\n Enter The Size Of The Array");
scanf("%d",&n);
printf("\n Enetr The Elements Of The Array:");
for(i=0;i<n;i++)
{
scanf("%d",&ar[i]);
}
small=ar[0];
for(i=0;i<n;i++)
{
if(ar[i]<=small)
{
small=ar[i];
}
}
printf("\n Smallest Number Of The Array Is %d",small);
getch ();
}



Follow Us On Facebook !!!

No comments:

Post a Comment