Advertisement
ShagorSutradhar

If else maximum between two numbers

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