Question: in C + + ; Write a program that outputs all integers within a range. The program takes three integer inputs. The first two integers

in C++; Write a program that outputs all integers within a range. The program takes three integer inputs. The first two integers are the low and high integers of the range. The third integer indicates whether the range is inclusive or exclusive: 0 excludes the low and high integers, and 1 includes the low and high integers. Assume the first two integers are never the same. You are required to use a For loop.
Ex: If the input is 5101, the output is:
5678910
Ex: If the input is 5100, the output is:
6789
Ex: If the input is 671
67
Ex: If the input is 670
No output.
Ex: If the second integer is less than the first, as in 2051, the output is:
No output.
For coding simplicity, output a space after every integer, including the last.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!