Write a program to find greatest number among 3 numbers

Hello everyone here is a another program to check out the Greatest number among three.

Greatest number among three

Greatest number among three

Previously i have made a post on another topic “finding greatest among 2”

one of my Friend requested me to make another post on finding greatest number among three so here is the program.

 

#include<stdio.h>
#include<conio.h>

void main()
{
int x,y,z,gr;
printf("Enter 3 Numbers \n");
scanf("%d%d%d",&x,&y,&z);

gr=x;
if(y>gr&&y>z)
gr=y;
else
if(z>gr)
gr=z;
printf("The Greatest Number among %d %d %d is %d",x,y,z,gr);
getch();
}

 

 

 

Thanks all