kucheasysa

greatest of 3 integers

Jun 6th, 2023
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a, b, c, max;
  5.  
  6. printf("Enter three integers: ");
  7. scanf("%d %d %d", &a, &b, &c);
  8.  
  9. max = a;
  10.  
  11. if (b > max) {
  12. max = b;
  13. }
  14.  
  15. if (c > max) {
  16. max = c;
  17. }
  18.  
  19. printf("The maximum number is: %d\n", max);
  20.  
  21. return 0;
  22. }
  23.  
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment