Answer to Question #280132 in C for sable

Question #280132

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:

  1. Input two integers in one line, separated by a space. The first integer shall represent the starting point, and the other, the ending point.
  2. Print out all even numbers that are within the range of the starting and ending point (inclusive or including the ending point).


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.


1
Expert's answer
2021-12-17T06:52:00-0500
#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;
}

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
New on Blog
APPROVED BY CLIENTS