Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,input = 1;
- float sum = 0, parQuant = 0;
- while (input != 0)
- {
- printf("Entre com um numero natural :\n");
- scanf("%d",&input);
- if ((input%2 == 0)&&(input != 0))
- {
- sum = sum + input;
- parQuant++;
- }
- }
- printf("Media = %f\n",sum/parQuant);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment