Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define N 10
- int main()
- {
- int i;
- float sum = 0;
- float sr;
- float tab[N];
- printf("Podaj %d elementów tablicy:\n",N);
- for (i=0; i<N; i++)
- {
- scanf("%f", &tab[i]);
- sum+=tab[i];
- }
- sr=sum/N;
- printf("Srednia arytmetyczna to: %.2f\n", sr);
- for (i = 0; i < N; i++)
- {
- if (tab[i]>0 && tab[i]>sr)
- {
- printf("Liczby dodatnie, większe od redniej arytmetycznej= %.2f\n ", tab[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement