Question

#include <iostream> using namespace std; int main() {    } Write a program that, given a...

#include <iostream>
using namespace std;

int main()
{
  
}

Write a program that, given a user-specified integer, prints out the next 10 integers (in increasing order; each on its own line).

For example, given an input of 3, the console content following a run of the completed program will look as follows:

 
 

Enter a number: 3

 
 

4

 

5

 

6

 

7

 

8

 

9

 

10

 

11

 

12

 

13

 
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please upvote if you like the answer, as it helps the community a lot.

Also if you have any doubts, feel free to ask in comments, we will reach you ASAP.

SOLUTION(ans.cpp):

#include <iostream>
using namespace std;

int main()
{

int i, n;

cout<<"Enter a number: ";

cin>>n;

// loop for printing next 10 numbers

for(i=n+1;i<=n+10;i++)

{

cout<<i<<endl;

}

return 0;

}

SAMPLE INPUT/OUTPUT:

Enter a number: 4

5

6

7

8

9

10

11

12

13

14

Add a comment
Know the answer?
Add Answer to:
#include <iostream> using namespace std; int main() {    } Write a program that, given a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT