Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main() {
- int i, num;
- float contI=0;
- float contP=0;
- float par=0;
- float imp=0;
- float mediaP=0;
- float mediaI=0;;
- for(i=0; i<4; i++) {
- printf("Digite um numero \n");
- scanf("%d", &num);
- if(num %2 == 0) {
- par += num;
- contP += 1;
- } else {
- imp +=num;
- contI += 1;
- }
- }
- mediaP = par / contP;
- mediaI = imp / contI;
- printf("\n MEDIA PAR %f", mediaP);
- printf("\n \n MEDIA IMPAR %f", mediaI);
- printf("\n \n QUANTIDADE DO PAR %f", par);
- printf("\n \n QUANTIDADE DO IMPAR %f", imp);
- if(contI > contP) {
- printf("\n \n O maior e o impar\n");
- } else {
- printf("\n \n O maior e o par\n");
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement