Ask Question
5 October, 14:02

Write code that prints: Ready! userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after each line of text Ex: userNum = 3 outputs: Ready! 3 2 1 Blastoff!

+5
Answers (1)
  1. 5 October, 16:37
    0
    The program to this can be described as follows:

    Program:

    #include / /defining header file

    using namespace std;

    int main () / /defining main method

    {

    int number, l, value=0; / /defining integer variables

    cout<<"UserNum = "; / /print message

    cin>>number; / /input value by user-end

    cout<<"Ouput: Ready!"<
    for (l=1; l
    {

    value=number-l; / /calculate value

    cout<
    }

    cout<<"Blastoff!"; / /print message

    return 0;

    }

    Output:

    UserNum = 3

    Ouput: Ready!

    3

    2

    1

    Blastoff!

    Explanation:

    Description of the above code:

    Three integer variable "number, l, and value=0" is defined in this program, in which the number variable takes input from the end and the variable l and value is used in the loop to calculate the value in reverse order. In the for loop is declared, a variable value is defined, which calculates the value in reverse order and uses a print method to print the value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write code that prints: Ready! userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers