TÓPICO
5% de Erro e não consigo identificar
LeandroCarvalho perguntou 3 years ago
include
int main() { int par=0,impar=0,p=0,n=0,x;
for(x=1; x<=5; x++){
scanf("%i",&x);
if(x%2==0){
par++;
}
else if(x%2!=0){
impar++;
}
if(x>0){
p++;
}
else if(x<0){
n++;
}
}
printf("%i valor(es) par(es)\n",par);
printf("%i valor(es) impar(es)\n",impar);
printf("%i valor(es) positivo(s)\n",p);
printf("%i valor(es) negativo(s)\n",n);
return 0;
}
Este tópico foi resolvido e não pode receber novas respostas.