This Program Will Find Out The Largest Among Few user Given Number. The Numbers Entered By The User Must Be Positive.
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,i,n;
b=0;
printf("\n\tEnter How Many Number You Want To Enter:==");
scanf("%d",&n);
for(i=0;i<n;i++)
{
input:
{
printf("\n\tEnter No[%d]:==",i+1);
scanf("%d",&a);
}
if(a<0)
{
printf("\n\tThe Input Was Wrong Number Must Be 0 Or Positive");
goto input;
}
else
{
if(a>=b)
{
b=a;
}
}
}
printf("\n\tThe Largest Number You Have Entered:==%d",b);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,i,n;
b=0;
printf("\n\tEnter How Many Number You Want To Enter:==");
scanf("%d",&n);
for(i=0;i<n;i++)
{
input:
{
printf("\n\tEnter No[%d]:==",i+1);
scanf("%d",&a);
}
if(a<0)
{
printf("\n\tThe Input Was Wrong Number Must Be 0 Or Positive");
goto input;
}
else
{
if(a>=b)
{
b=a;
}
}
}
printf("\n\tThe Largest Number You Have Entered:==%d",b);
getch();
}