Displaying all even numbers forom 0 to upper limit

October 14, 2015 at 18:08:41
Specs: Windows 7
# include <iostream>
# include <iomanip>

using namespace std;

int main()
{
int count = 0;
int number;

cout << "Enter the upper limit: ";
cin >> number;

while (count <= number)
{

if (number % 2 == 0)
{
count++;
}
}
return 0;
}


See More: Displaying all even numbers forom 0 to upper limit

Report •


#1
October 14, 2015 at 20:08:24
Is there a question you would like to ask?

Report •
Related Solutions


Ask Question