7.3k views
2 votes
Ask the user to input an integer. Print out the next three consecutive numbers.

User DarKnight
by
5.4k points

2 Answers

5 votes

Answer:

a = float(input("Enter an integer: "))

print(a + 1)

print (a + 2)

print (a + 3)

Step-by-step explanation:

Takes any number user inputs, and next three numbers that come out are what the given number is plus one, then two, then three.

For example :

Enter an integer: 4

5

6

7

User Ocho
by
6.1k points
5 votes

Answer:

Codes are given below:

Step-by-step explanation:

Since the language is not specified, I am writing it in c++

#include <iostream>

using namespace std;

int main() //Start of main function

{

int number;

cout << "Enter your number"<<endl;

cin >> number; //this will take your number as an input

cout <<"The next three numbers are: " << number + 1 << endl; //this will write the next number to your input input

cout << number + 2 << endl;

cout << number + 3 << endl;

return 0;

} //End of main function

User Ashg
by
6.1k points