Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int MAX(int x, int y){
  4. int max;
  5. max=((x>y)?x:y);
  6. return max;
  7. }
  8.  
  9. int MAXIMUM(int x, int y, int z){
  10. int max;
  11. max=((x>=y)?MAX(x,z):MAX(y,z));
  12. return max;
  13. }
  14.  
  15. int main()
  16. {
  17. int a,b,c,max;
  18.  
  19. printf("Podaj a: ");
  20. scanf("%d",&a);
  21. printf("Podaj b: ");
  22. scanf("%d",&b);
  23. printf("Podaj c: ");
  24. scanf("%d",&c);
  25.  
  26. max=MAXIMUM(a,b,c);
  27. printf("Największa liczba to: %d\n", max);
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement