Program Description:

In this program we are going to find out the greatest number of the n numbers entered by the user. First we will ask the user that between how many numbers he wants to check the greatest number. then we will ask him to enter n numbers. After user has entered n numbers, we will find out the greatest and show it in the output screen.

Source Code:

#include<stdio.h>
int main()
{
int num,n[50],i,greatest;
printf("How many numbers you want to check:");
scanf("%d",&num);
printf("Enter %d numbers:\n",num);
for(i=0;i<num;i++)
scanf("%d",&n[i]);
greatest=n[0];
for(i=1;i<num;i++)
if (n[i]>greatest)
greatest=n[i];
printf("The Greatest number is %d",greatest);
}

Output:




If you have any queries feel free to ask us in the comments section below!!