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

Answer :

Explanation:

#include <iostream.h>

#inlcude<conion.h>

void main()

{

  int count, x;

  clrscr();

  cout<<"Enter the count:";

  cin>> count;

  cout<<"Ready!\n";

  for(x=count;x>0;x--)

  {

     cout<<x<<"\n";

  }

  cout<<"Start";

  getche();

}

This is a simple program where the output is expected to be in reverse order. So we run a for loop starting from the count and decrements the counter by 1 every time when the loop runs and print the value. So to print the output in "new line" we include "\n".

Other Questions