Answer to Question #15276 in C++ for Bill Jovan

Question #15276
write a program that ask a user to enter a number n and display the first n even number
1
Expert's answer
2012-09-25T11:33:29-0400
#include <iostream>
using namespace std;
int main (){

int n;

cout<<"Enter number n please!\n";

cin>> n ;

if (n%2 == 0) cout<< "It's even number" << ' ' << n <<endl;
else cout<< "It's not even number" << ' ' << n <<endl;


system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS