C Program to Find Greatest of Three Numbers
The following example shows, how to find greatest of three numbers in C Program.
Example : pgm.c
#include<stdio.h> int main(){ int a=10,b=65,c=34; if(a>b&&a>c){ printf("\n%d is Greatest number",a); }else if(b>a&&b>c){ printf("\n%d is Greatest number",b); }else if(c>a&&c>b){ printf("\n%d is Greatest number",c); }else{ printf("\nAny two numbers are equal or all are equal"); } return 0; }
Output:
65 is Greatest Number