View difference between Paste ID: ggPq0N8E and 5yacSi43
SHOW: | | - or go back to the newest paste.
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
float maxtemp(float temp[8])
5
{
6
    int i, maxi=temp[0];
7
    for(i=0;i<8;i++)
8
    {
9
        printf("unesite %d. clan",i+1);
10
        scanf("%d",&temp[i]);
11
        if (temp[i]>maxi) maxi=temp[i];
12
    }
13
    return maxi;
14
}
15
16
float prosjek(float temp[8])
17
{
18
    int i, suma=0, brojac=0, pros;
19
    for (i=0;i<8;i++)
20
    {
21
      printf("unesite %d. clan",i+1);
22
        scanf("%d",&temp[i]);
23
        brojac++;
24
        suma+=temp[i];
25
    }
26
    pros=suma/brojac;
27
    return pros;
28
}
29
30
int main()
31
{
32
    int i;
33
    float a[8];
34
    for(i=0;i<8;i++)
35
    {
36
        printf("unesi temperature ");
37-
        scanf("%f",a[i]);
37+
        scanf("%f",&a[i]);
38
    }
39
    printf("%f", prosjek(a));
40
    printf("%f" ,maxtemp(a));
41
    return 0;
42
}