Siddabelle3432 Siddabelle3432
  • 12-03-2020
  • Computers and Technology
contestada

"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!"

Respuesta :

janehill33 janehill33
  • 20-03-2020

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".

Answer Link

Otras preguntas

Tom is the deli manager at a grocery store. He needs to schedule employees to staff the deli department at least 260260260 person-hours per week. Tom has one pa
The rock in the picture is pushed over the edge and it begins to fall. Which type of energy conversion is taking place? A) mechanical to heat B) sound to
how many holes does a flute have​
Match the following. 1. dense current of clastic sediments and water turbidity current 2. formation of rock from sediment petrification 3. decrease in volu
the flow of a river can be determined by?​
Find the GCF of these two plz help
How many groups will be made if you split $13.50 into groups of $2.25 each?
To the nearest hundredth, what is the measure of line segment RT?
What is the multiplicative inverse of 1/2 -2 -1/2 2
Describe two differences between Locke's and Maslow's theory of motivation..