Program to display maximum of three integers using if else

//Program to display maximum of three integers using if else
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c;
clrscr();
printf("Enter Three Integer Numbers\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
    if(a>c) printf("%d is Maximum",a);
    else    printf("%d is Maximum",c);
}
else
{
    if(b>c) printf("%d is Maximum",b);
    else printf("%d is Maximum",c);
}


getch();
return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment