Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- float maxtemp(float temp[8])
- {
- int i, maxi=temp[0];
- for(i=0;i<8;i++)
- {
- printf("unesite %d. clan",i+1);
- scanf("%d",&temp[i]);
- if (temp[i]>maxi) maxi=temp[i];
- }
- return maxi;
- }
- float prosjek(float temp[8])
- {
- int i, suma=0, brojac=0, pros;
- for (i=0;i<8;i++)
- {
- printf("unesite %d. clan",i+1);
- scanf("%d",&temp[i]);
- brojac++;
- suma+=temp[i];
- }
- pros=suma/brojac;
- return pros;
- }
- int main()
- {
- int i;
- float a[8];
- for(i=0;i<8;i++)
- {
- printf("unesi temperature ");
- scanf("%f",&a[i]);
- }
- printf("%f", prosjek(a));
- printf("%f" ,maxtemp(a));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment