Search This Blog

Sep 27, 2013

C program to read number and print maximum

/*program to read number and print maximum*/
#include<conio.h>
#include<stdio.h>
void main()
{
int a,b,c,d,m;
clrscr();
printf("Enter four numbers ");
scanf("%d%d%d%d",&a,&b,&c,&d);
m=0;
if(a>m)
m=a;
if(b>m)
m=b;
if(c>m)
m=c;
if(d>m)
m=d;
printf("\nRESULT:\n%d is the grater no.",m);
getch();
}

No comments:

Post a Comment