WAP to accept ‘n’ numbers as input and find the largest number of them using while loop
WAP to accept ‘n’ numbers as input and find the
largest number of them using while loop
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],s=0;
int i;
clrscr();
for(i=0;i<5;i++)
{scanf("%d",&a[i]);
}
i=0;
while(i<5)
{
if(a[i]>s)
s=a[i];
i++;
}
printf("%d",s);
getch();
}