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;
- while (userInput != EOF)
- {
- printf("Entrez un nombre : (CTRL-D pour arreter)\n");
- scanf("%d", &userInput);
- if(userInput != EOF && userInput % 2 == 0)
- {
- somme += userInput;
- printf("La somme des nombres pairs entres est de : %d\n", somme);
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement