Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int n, par=0,mediap,somap=0,resp;
- printf("\t\t\tdigite varios valores:\n");
- do{
- printf("\t\t\t\t");
- scanf("%d",&n);
- if(n==0)
- break;
- if(n%2==0){
- par=par+1;
- somap=somap+n;
- }
- }
- while(resp!=0);
- mediap=somap/par;
- printf("\n \tTemos %d numeros pares,e a media deles equivale a %d\n\n\t\t",par,mediap);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment