Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int userInput = 0, somme = 0, diviseur = 1;
- while (userInput != -1)
- {
- printf("Entrez un nombre : (-1 pour arreter)\n");
- scanf("%d", &userInput);
- if(userInput != -1)
- {
- somme += userInput;
- printf("La moyenne des nombres entres est de : %d\n", somme/diviseur);
- diviseur++;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement