Skip to main content

Read 5 integers and print the largest

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,num,max=0;
for(i=1;i<=5;i++)
{
printf("Enter the number:");
scanf("%d",&num)
if(num>max)
max=num;
}
printf("Largest number is %d",max);
getch();
}

Comments

Popular posts from this blog

Reversing digits of a number

#include<stdio.h> #include<conio.h> void main() { clrscr(); int ,num,rev=0,rem; printf("Enter the number:"); scanf("%d",&num); while(num!=0) { rem=num%10; rev=rev*10+rem; num=num/10; } printf("Reverse of given Number is:%d",rev); getch(); }