Advertisement
ShagorSutradhar

Maximum between three numbers

Feb 27th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int num1, num2, num3, max;
  6.  
  7. printf("Enter three numbers: ");
  8. scanf("%d%d%d", &num1, &num2, &num3);
  9.  
  10. if((num1>num2) && (num1>num3))
  11. {
  12. max=num1;
  13. }
  14. else if(num2>num3)
  15. {
  16. max=num2;
  17. }
  18. else
  19. {
  20. max=num3;
  21. }
  22.  
  23. printf("Maximum among all three numbers=%d", max);
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement