Thursday 21 February 2013

C++ program to check even or odd using arrays.

| |








#include<iostream>
#include<string>


using namespace std;
int main()
{
  
    int z, array[z], n,integer,f;
cout<<"Upto how many nos?"<<endl;
cin>>z;
    cout<<"Enter The Numbers"<<endl;
for(n=0;n<z;n++)    
    {cin>>integer;
    array[n]=integer;
}


for(n=0;n<z;n++)
{if ( array[n] % 2== 0 )



       cout << array[n]<< " is even "
       <<endl;
  else



       cout << array[n]<< " is odd "
       <<endl;}
        
           
  system("pause");
return 0;
}
 

C++ program to check even or odd using arrays.


Related Posts Plugin for WordPress, Blogger...
Powered by Blogger.