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