C-Program To Find The Biggest Number Among n Numbers (Biggest in an Array)
#include<stdio.h>
main ()
{
int n,i,j,big,a[50];
printf("Enter the Number of elements\t");
scanf("%d",&n);
printf("Enter the elemnts\t");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
big=a[i];
}
}
}
printf("The biggest Number is %d",big);
}
 |
| output |
No comments:
Post a Comment