limondew

max and min

Dec 13th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a,b,c,max;
  5. printf("Enter three numbers: ");
  6. scanf("%d %d %d",&a,&b,&c);
  7. if((a>b)&(a>c))
  8. {max=a;}
  9. else if((b>a)&(b>c))
  10. {max=b;}
  11. else if((c>a)&(c>b))
  12. {max=c;}
  13. printf("maximum among all three numbers=%d",max);
  14. return 0;
  15. }
Add Comment
Please, Sign In to add comment