C++/c++ programing question
Expert: Prince M. Premnath - 4/27/2010
QuestionI'm not so good in c++ so I've tried to answer these questions but i couldn't, so i would like to get your help please as soon as possible.. write a program to input 10 numbers and print only the even ones. thanks allot.
AnswerHi Dear Jordan !
Sorry for the delay in responding your query :( please find the programme below
#include <iostream.h>
#include <iomanip.h>
int main()
{
int _Array[10];
cout<<"Enter 10 numbers"<<endl;
for(int _iIndex = 0 ; _iIndex < 10 ; _iIndex++)
cin>>_Array[_iIndex];
cout<<"Even Numbers :"<<endl;
for(_iIndex = 0 ; _iIndex < 10 ; _iIndex++)
if(_Array[_iIndex] % 2 == 0)
cout<<_Array[_iIndex]<<endl;
return 0;
}
feel free to get back to me in case of issues or if you require more explanation :)
Thanks and Regards
Prince M. Premnath