// this is a C program that read three numbers (a,b,c) and finds the maximum number.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n\n Enter 1st number :");
scanf("%d",&a);
printf("\n Enter 2nd number :");
scanf("%d",&b);
printf("\n Enter 3rd number :");
scanf("%d",&c);
if((a>b)&&(a>c))
printf("\n\n The maximum number among %d, %d and %d is %d.",a,b,c,a);
else if (b>c)
printf("\n The maximum number among %d, %d and %d is %d.",a,b,c,b);
else
printf("\n The maximum number among %d, %d and %d is %d.",a,b,c,c);
getch();
}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment
If you have any confusion, Please leave a comment. I will assist you. Do not include any URL in comments.