C++ Program to enter 'n' numbers and display no. of odd, even and numbers entered till user wishes.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=0,b,o=0,e=0;
char z;
do
{
++a;
cout<<"Enter a number: ";
cin>>b;
if(b%2==0)
++e;
else
++o;
cout<<"Enter another number? (y/n): ";
cin>>z;
}
while(z=='y'||z=='Y');
cout<<"Number of number entered: "<<a<<endl;
cout<<"Number of even numbers: "<<e<<endl;
cout<<"Number of odd numbers: "<<o<<endl;
getch();
}