C Program to find largest of n numbers - c programs
// write a c program to find largest of n numbers
// Maximum of n numbers in / using c language
//write a c program to find largest of n numbers
// Maximum of n numbers in / using c language
#include<stdio.h>
main()
{
int n,m[100],i,max;
printf("How many numbers(n) you going to enter:");
scanf("%d",&n);
printf("Enter the numbers:");
scanf("%d",&m);
max=m;
for(i=2;i<=n;i++)
{
scanf("%d",&m[i]);
if(m[i]>max)
max=m[i];
}
printf("The Largest Number is %d",max);
}
No comments:
Post a Comment