You know, I was lying when I said the last time that numbers associated with 3 are my favorite, because the one I actually like the most in the world are even numbers! But to make things harder for you, you have to pick the even numbers from a range of two given numbers. Ha!
Now, let's try this one more time!
Instructions:
Input
1. The starting point
2. The ending point
Output
The first line will contain a message prompt to input the starting point.
The second line will contain a message prompt to input the ending point.
The last line contains the integers within the range.
#include <iostream>
using namespace std;
int main()
{
int start_point, end_point;
cout<<"Enter Starting Point: ";
cin>>start_point;
cout<<"Enter Ending Point: ";
cin>>end_point;
for (int i = start_point; i<=end_point; i++)
{
if (i % 2 == 0)
{
cout<<i<<endl;
}
else
{
continue;
}
}
return 0;
}
Comments
Leave a comment