-1
I am trying to create a program in C which asks for 10 numbers. You must display the amount of negative, positive and typed zeros. I’ve tried it here but it’s not working. Reading from scratch is incorrect, and asking for 11 variables instead of 10. Would you like to know what’s wrong? Yeah, I can’t figure it out
#include<stdio.h>
main(){
int z,i;
int x = 0;
int y = 0;
int h = 0;
for(i=0;i<=10;i++){
printf("digite o numero:");
scanf("%d",&x);
if (x<0){
++y;
} if(x>0);{
++z;
} if (x % 10 == 0);{
++h;
}
}
printf("\n no total foram\n %i numeros positivos\n %i negativos \n %i 0 digitados.",z,y,h);
return 0;
}