source name: max3.C
#include<stdio.h>
void main()
{
int a,b,c;
clrscr();
printf(" enter any three numbers: \n ");
scanf("%d%d%d", &a, &b, &c);
if(a>b && a>c)
printf(" \n maximum is A number=%d ",a);
if(b>c)
printf(" \n maximum is B number=%d ",b);
else
printf(" \n maximum is C number=%d ",c);
getch();
}
output:
enter any three numbers: 100 200 150
maximum is B number=200
enter any three numbers: 1200 452 750
maximum is A number=1200
enter any three numbers: 100 -20 1500
maximum is C number=1500
0 Comments
Post a Comment