Advertisement
Dido09

C - Largest of Three Numbers

May 23rd, 2022
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(){
  5.  
  6. int num1, num2, num3;
  7.  
  8. printf("Enter three integers: ");
  9. scanf("%d %d %d", &num1, &num2, &num3);
  10.  
  11. if(num1 > num2 && num1 > num3)
  12.     printf("%d is the largest", num1);
  13.     else
  14. if(num2 > num1 && num2 > num3)
  15.     printf("%d is the largest", num2);
  16.     else
  17. if(num3 > num1 && num3 > num2)
  18.     printf("%d is the largest", num3);
  19.  
  20. return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement