thank you KansaiRobot
Code:
#include<stdio.h>
int main()
{
int count =0;
int A=0,B=0,C=0,D=0;
char into;
printf(" A for mathematics\n B for ecnomics\n C for programming\n D for physics\n");
while(count<=20)
{
printf(" what is your favorite subject\n");
scanf("%c",&into);
if(into =='A'){A+=1;}
else if (into == 'B'){B+=1;}
else if (into =='C'){C+=1;}
else if (into =='D'){D+=1;}
count++;
}
printf("Number of people who chose A answer =%d\n",A);
printf("Number of people who chose B answer =%d\n",B);
printf("Number of people who chose C answer =%d\n",C);
printf("Number of people who chose D answer =%d\n",D);
return 0;
}
Where is the error in this code whene i run it
it print every thing 2 times Why