Ask Question
14 October, 13:24

Write code that prints: Ready! firstNumber ... 2 1 Run! Your code should contain a for loop. Print a newline after each number and after each line of text Ex: firstNumber

+5
Answers (1)
  1. 14 October, 14:35
    0
    The program to this question can be describes as follows:

    Program:

    #include / /defining header file

    int main () / /defining main method

    {

    int n, i, x=0; / /defining integer variable

    printf ("Enter a number: "); / /print message

    scanf ("%d",&n); / /input value from the user

    printf ("%d/n", n); / /print input value

    for (i=1; i
    {

    x=n-i; / /calculate value

    printf ("%d/n", x); / /print value

    }

    return 0;

    }

    Output:

    Enter a number: 3

    3

    2

    1

    Explanation:

    In the above program, three integer variable "n, i and x" is declared, in which variable n we take input from the user end and the variable i and x is used in the loop to calculate the value in the reverse order. In the next step, a loop is declared, in which the variable x calculates the value in reverse order and uses a print method to print its value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write code that prints: Ready! firstNumber ... 2 1 Run! 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