Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int num1, num2, num3;
- printf("Enter three numbers: ");
- scanf("%d %d %d", &num1, &num2, &num3);
- // Maximum calculation using only if statements
- if (num1 > num2 && num1 > num3)
- {
- printf("Maximum number is: %d\n", num1);
- }
- if (num2 > num1 && num2 > num3) {
- printf("Maximum number is: %d\n", num2);
- }
- if (num3 > num1 && num3 > num2) {
- printf("Maximum number is: %d\n", num3);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement