Determine the greatest of three numbers.

#include <stdio.h>

int main(void)
{
int x, y, z;

printf("\nEnter three numbers : ");
scanf("%d%d%d", &x, &y, &z);

if(x > y)
{
if(x > z)
{
printf("\n%d is the greatest",x);
}
else
{
printf("\n%d is the greatest",z);
}
}
else
{
if(y > z)
{
printf("\n%d is the greatest",y);
}
else
{
printf("\n%d is the greatest",z);
}
}

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin