I don't understand what's wrong. My program prints only half the output. It doesn't print the maximum number. Here's the code if you wanna check it.
Code:
#include <stdio.h> int main() { int a, b, c; int max; printf("\n1st number: "); scanf("%d", &a); printf("\n2nd number: "); scanf("%d", &b); printf("\n3rd number: "); scanf("%d", &c); if (b > a && b > c){ max = b; printf("\nMax number is ", max); } if (c > a && c > b){ max = c; printf("\nMax number is ", max); } if (a > b && a > c){ max = a; printf("\nMax number is ", max); } return 0; }
Comment