WAP that allows the user to enter numbers till the user wants and at the end it displays the number of positive numbers, negative numbers and zeroes entered.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,cpos=0,cz=0,cneg=0;
clrscr();
printf("\nEnter a number: ");
scanf("%d",&n);
do
{
if(n>0)
cpos++;
if(n==0)
cz++;
if(n<0)
cneg++;
}
while(scanf("%d",&n)!=EOF);
printf("\nThe count of positive numbers is %d",cpos);
printf("\nThe count of zeroes is %d",cz);
printf("\nThe count of negative numbers is %d",cneg);
getch();
}