Created
January 19, 2017 16:26
-
-
Save Sevitte/ad8ce74a42663df0e15ae1e1b792a377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int a; | |
printf ("Podaj z ilu liczb chcesz liczyc srednia:\n"); | |
scanf ("%i", &a); | |
int b; | |
int i; | |
int suma; | |
float srednia; | |
for (b=0; b<a; b++) | |
{ | |
printf ("Podaj liczbe:\n"); | |
scanf ("%i", &i); | |
suma=suma+i; | |
printf ("%i", suma); | |
} | |
srednia=suma/a; | |
printf("Srednia arytmetyczna wynosi %f", srednia); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment