Menus

Monday 9 December 2019

Write a C program for to find largest among three numbers


#include<stdio.h>

void main()
{

int x,y,z;

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

if((x>y) && (x>z))
{
printf("The greater value is %d\n",x);
}
else if(y>z)
{
printf("The greater value is %d\n",y);
}
else
{
printf("The greater value is %d\n",z);
}

}







No comments:

Post a Comment