Problem Statement
Write a C program to count how many positive and negative number entered without storing them in any of data storing data types such as array
Write a C program to count how many positive and negative number entered without storing them in any of data storing data types such as array
#include<stdio.h>
int main()
{
int pos,neg,a,zero;
pos=neg=zero=0;
printf("enter the number resp. press ctrl-d in the end\n");
while(scanf("%d",&a)!=EOF)
{
if(a>0)
{
pos=pos+1;
}
else if(a<0)
{
neg=neg+1;
}
else
{
zero=zero+1;
}
}
printf("the number of positive number entered is %d and negative is %d \n",pos,neg);
printf("the number of nonnegative number is %d and nonpositive number is %d\n",pos+zero,neg+zero);
return 0;
}
I want to express some appreciation to this writer just
ReplyDeletefor bailing me out of this type of setting. Right after searching
throughout the the net and coming across strategies that were not powerful, I thought
my life was done. Living devoid of the solutions to the problems
you have sorted out by means of this guide
is a serious case, as well as the ones which may have in a
wrong way damaged my career if I had not encountered your blog.
Your actual natural talent and kindness in maneuvering a lot of things was crucial.
I am not sure what I would've done if I hadn't
encountered such a point like this. I can at this moment relish my future.
Thank you so much for this skilled and result oriented
help. I will not hesitate to propose your web sites to anybody who
should get direction about this problem.
my blog - messen penislänge :: epetdate.com ::