| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Jul 2008 12:39:31 IST
|
|
|
WAP in c++ to enter 5 nos and print the no of +ve nos,-venos and zeroes
|
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Jul 2008 12:41:40 IST
|
|
|
i can giv it in C lang......u can take its logic and write it in C++.... ok??
|
i am well....and hope u r in the same well.... |
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Jul 2008 12:43:27 IST
|
|
|
Re:Sorry,but i cannot understand c language
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Jul 2008 12:53:05 IST
|
|
|
U CAN DERIVE IT YAAAR DONT WRY..U WILL UNDERSTAND IT....NOT MUCH DIFFERENCE....
|
i am well....and hope u r in the same well.... |
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Jul 2008 14:30:51 IST
|
|
|
int a[5];
int z =0//no. of zero
int p=0//no. of positive
int n=0//no. of negative
//input
for(int i=0; i<=4;i++)
cin>>a[i];
//condition
for(i=0; i<=4;i++)
{
if(a[i]==0)
z++;
else
{
if(a[i]>=0)
p++;
else
n++;
}
}
//output
cout<<z<<p<<n;
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
|
|