Ask Question

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

+2
Answers (1)
  1. 7 December, 13:02
    0
    Code to this question can be described as follows:

    Program:

    #include / /defining header file

    using namespace std;

    int main () / /defining main method

    {

    int n1, j, x1=0; / /defining integer variable

    cout<<"Enter a number: "; / /print message

    cin>>n1; / /input value from the user

    cout<
    for (j=1; j
    {

    x1=n1-j; / /calculate value

    cout<
    }

    return 0;

    }

    Output:

    Enter a number: 3

    3

    2

    1

    Explanation:

    In the above C+ + language program, three integer variable "n1, j and x1" is declared, in which variable n1 take input from the user end and the variable j and x1 are used in the loop to calculate the value in the reverse order. In the next step, a for loop is declared, in which the variable x1 calculates the value in reverse order and uses a print method to print its value.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write code that prints: Ready! numVal ... 2 1 Start! Your code should contain a for loop. Print a newline after each number and after each ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers