Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- float min(float *t);
- float max(float *t);
- void affiche(int n,float *t);
- float min(float *t)
- {
- int i;
- float x;
- x=*t;
- for(i=1;i<8;i++)
- if (x>*(t+i))
- x=*(t+i);
- return x;
- }
- float max(float *t)
- {
- int i;
- float x;
- x=*t;
- for(i=1;i<8;i++)
- if (x<*(t+i))
- x=*(t+i);
- return x;
- }
- void affiche(int n, float *t)
- {
- int i;
- for(i=0;i<n;i++)
- printf("%f",*(t+i));
- }
- void main()
- {
- float liste[8]={1.6,-6,9.67,5.90,345,-23.6,78,34.6};
- int n;
- printf("longueur à afficher");
- scanf("%d",&n);
- printf("min=%f\n", min(liste));
- printf("max=%f\n", max(liste));
- affiche(n,liste);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement