bouchnina

exercice2-1

Dec 6th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. float Min(float a,float b);
  3. float Max(float a,float b);
  4. int main()
  5. {
  6. float a,b,min,max;
  7. printf("Entrez Deux nombres :");
  8. scanf("%f %f",&a,&b);
  9. min=Min(a,b);
  10. max=Max(a,b);
  11. printf("le maximum est : %.2f \nle minimum est : %.2f",max,min);
  12. system("pause");
  13. return 0;
  14. }
  15. float Min(float a,float b)
  16. {
  17. float res;
  18. if(a<b) res=a;
  19. else if(b<a) res=b;
  20. return res;
  21. }
  22. float Max(float a,float b)
  23. {
  24. float res;
  25. if(a<b) res=b;
  26. else if(b<a) res=a;
  27. return res;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment