Question

# Uses a while loop to print the numbers from 3 - 19. Uses a do-while loop...

• Uses a while loop to print the numbers from 3 - 19.
• Uses a do-while loop to print the numbers from 42 - 56.
• Uses a for loop to print the numbers from 87 - 95.
• Asks the user for 2 numbers. Uses a loop to print all numbers between the given numbers, inclusive.
• Note: Consider that your user's second number can be lower! (see example below)
• Note: Also consider that your user might give you two of the same number.
• Use a while, do-while, and for loop. The fourth loop is your choice.
• Actively use in-line comments stating what each section of code does.
• Use try/catch, BUT only if necessary.
• Your program must conform to the Java coding standards
• This is an example of what your program should output:
• ```I'm going to print out the numbers 3-19 using a while loop:
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

I'm going to print out the numbers 42-56 using a do-while loop:
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

I'm going to print out the numbers 87-95 using a for loop:
87 88 89 90 91 92 93 94 95

Now I'll print whatever numbers you'd like!
Give me a starting number:
2
Give me an ending number:
-4
I see that your ending number is lower. Okay, I'll count down!
2 1 0 -1 -2 -3 -4
----jGRASP: operation complete.```

``````#include<iostream>
using namespace std;

main()
{
int i=3;
while(i<=19)
{
cout<<i<<" ";
i++;
}
cout<<endl;
int j=42;
do
{
cout<<j<<" ";
j++;
}while(j<=56);

cout<<endl;
for(int k=87;k<=95;k++)
cout<<k<<" ";

cout<<endl;
cout<<"enter two numbers"<<endl;
int x,y;
cin>>x>>y;
if(x<=y)
{
for(int a=x;a<=y;a++)
cout<<a<<" ";
cout<<endl;
}
else
{
for(int a=x;a>=y;a--)
cout<<a<<" ";
cout<<endl;
}
return 0;
}
``````

#### Earn Coins

Coins can be redeemed for fabulous gifts.