C++ Program – Sum of Odd Even nos

by Nideesh C on May 2, 2011 · 0 comments

in C++




//Downloaded From theonlinetutorials.com
//(C)1999.All rights reserved.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int p=0,nn=0,i,n,a;
cout<<"Enter teh limit :"<<endl;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a;
if(a>0)
p=p+1;
else
nn=nn+1;
}
cout<<"No of +ve ="<<p;
cout<<"No of negative ="<<nn;
getch();
}



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C++ program – Sum of n even Nos
  2. C++ Program – Sum of Odd +ve & -ve
  3. C program to find the sum of odd numbers and sum of even numbers from 1 to N. Output the computed sums on two different lines with suitable headings
  4. Sample – Program to enter an integer and find out if it is even or odd.
  5. C++ program – Check for Odd or Even

Leave a Comment

Previous post:

Next post: