find the greatest value out of three numbers
#include <stdio.h>
#include<conio.h>
int main(){
int a, b, c;
printf("Enter a,b,c: ");
scanf("%d %d %d", &a, &b, &c);
if (a > b && a > c) {
printf("a is Greater than b and c");
}
else if (b > a && b > c) {
printf("b is Greater than a and c");
}
else if (c > a && c > b) {
printf("c is Greater than a and b");
}
else {
printf("all are equal or any two values are equal");
}
return 0;
}
Output:-
Enter a,b,c: 2
3
4
c is Greater than a and b
Comments
Post a Comment