Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- float Min(float a,float b);
- float Max(float a,float b);
- int main()
- {
- float N,min,max;
- int i;
- printf("veuillez entrez 4 nombres :\nentrer le premier nombre :");
- scanf("%f",&N);
- min=N;
- max=N;
- for(i=2;i<=4;i++)
- {
- printf("entrez le %d nombre :",i);
- scanf("%f",&N);
- min=Min(min,N);
- max=Max(max,N);
- }
- printf("le maximum est : %.2f \nle minimum est : %.2f\n",max,min);
- system("pause");
- return 0;
- }
- float Min(float a,float b)
- {
- float res;
- if(a<b) res=a;
- else if(b<a) res=b;
- return res;
- }
- float Max(float a,float b)
- {
- float res;
- if(a<b) res=b;
- else if(b<a) res=a;
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment