Program:
#include<stdio.h>
int main()
{
int x,y,z;
printf("Enter three numbers: \n");
scanf("%d %d %d",&x,&y,&z);
if(x>y)
{
if(x>z)
{
printf("%d is maximum number",x);
}
else
{
printf("%d is maximum number",z);
}
}
else
{
if(y>z)
{
printf("%d is maximum number",y);
}
else
{
printf("%d is maximum number",z);
}
}
return 0;
}
Output:
#include<stdio.h>
int main()
{
int x,y,z;
printf("Enter three numbers: \n");
scanf("%d %d %d",&x,&y,&z);
if(x>y)
{
if(x>z)
{
printf("%d is maximum number",x);
}
else
{
printf("%d is maximum number",z);
}
}
else
{
if(y>z)
{
printf("%d is maximum number",y);
}
else
{
printf("%d is maximum number",z);
}
}
return 0;
}
Output:
No comments:
Post a Comment