/*C Program to find Maximum of 3 nos. using Nested if*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
// clrscr();
printf("Enter three number\n\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(a>c)
{
printf("\n a is maximum");
}
else
{
printf("\n c is maximum");
}
}
else
{
if(b>c)
{
printf("\n b is maximum");
}
else
{
printf("\n c is maximum");
}
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
// clrscr();
printf("Enter three number\n\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(a>c)
{
printf("\n a is maximum");
}
else
{
printf("\n c is maximum");
}
}
else
{
if(b>c)
{
printf("\n b is maximum");
}
else
{
printf("\n c is maximum");
}
}
getch();
}
Hope you liked my posts, give comments if you have any doubts.. :)
Categories:
c program
0 comments:
Post a Comment