prev


While-Loop

54.Count of postive or negative or zero nos - until -1000 is given. (02.02.2010)

/*
Program# 54
date : 28-12-2008
Count of postive or negative or zero nos - until -1000 is given.
*/

#include <stdio.h>
main(){
int n=0,p=0,ne=0,z=0;
scanf("%d ",&n);
while(n!=-1000){
if(n>0)
p=p+1;
else
if(n<0)
ne=ne+1;
else
z=z+1;
scanf("%d ",&n);
}
printf("\n Positive : %d \n Negative : %d \n Zero : %d",p,ne,z);
}



next
blog comments powered by Disqus