Need Help! Sum of Even Numbers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <cctype>
#include <limits>

int main()
{
	std::cout << "Do you want someone to do all the work for you? ";
	char answer {};
	std::cin >> answer;

	std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

	if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }

	else { std::cout << "Show what have you coded so far.\n"; }

	std::cout << "Good luck.\n";
}


Seems the OP didn't like being reminded we aren't his private tutor service.
Last edited on
even numbers have a remainder of zero when divided by 2. That can be expressed in c++ with x%2.
Topic archived. No new replies allowed.