Advertisement
RAJIBRAJU

6.maximum in function

Jul 5th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. int MaxA (int a,int b,int c)
  3. {
  4.     if (a>b && a>c)
  5.     {
  6.         return a;
  7.     }
  8.     else if (b>a && b>c)
  9.     {
  10.         return b;
  11.     }
  12.     else if (c>a && c>b)
  13.     {
  14.         return c;
  15.     }
  16.  
  17.     else if (a==b==c)
  18.     {
  19.         return a;
  20.     }
  21. }
  22.  
  23. int main ()
  24. {
  25.     int a,b,c,max;
  26.     scanf("%d%d%d",&a,&b,&c);
  27.     max=MaxA(a,b,c);
  28.     printf("%d",max);
  29.  
  30.     return 0;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement