Ask Question
4 July, 03:23

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!

+4
Answers (1)
  1. 4 July, 04:37
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers