write a program to find the greatest number among 10 numbers in 1-d array.
#include<stdio.h>
#include<conio.h>
int main()
{
int a[10],large=0,i;
printf("enter 10 numbers\n");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
if(a[i]>large)
{
large=a[i];
}
}
printf("\n largest %d\n",large);
return 0;
}
Comments
Post a Comment