Copy the below code and save it and then compile & run to see the output of this program. I have compiled & run this program, see the output at the end of this program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include<stdio.h> int main() { int x, y, z; printf("\nEnter value of x, y & z : "); scanf("%d %d %d", &x, &y, &z); if ((x > y) && (x > y)) printf("\nx is greatest"); if ((y > z) && (y > x)) printf("\ny is greatest"); if ((z > x) && (z > y)) printf("\nz is greatest"); return(0); } |
Output is:
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: c program, c program list, c program to find greatest number, c programs, c programs with solutions