Hiiiiiiiiiiii!!!!!!!!!...........
The program written below runs perfectly upto some extent but the output varies............because the compiler prints the "{Enter the value}" line twice and itself adds a positive number in the counter..................
#include<stdio.h>
#include<conio.h>
int main()
{
int sum1=0,sum2=0,sum3=0;
char value,alpha;
while(alpha!='D')
{
printf("\n Enter the value");
scanf("%c",&alpha);
if(alpha==0)
{
sum1=sum1+1;
}
else if(alpha>0)
{
sum2=sum2+1; // for positive
}
else if(alpha<0)
{
sum3=sum3+1;
}
}
sum2=sum2-1;
printf("\n The zeros are %d", sum1);
printf("\n the positive are %d", sum2);
printf("\n the negative are %d",sum3);
getch();
}