1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kiruha [24]
3 years ago
13

Write a program that takes in an integer in the range 10 to 100 as input. Your program should countdown from that number to 0, p

rinting the count each of each iteration. After ten numbers have been printed to the screen, you should start a newline. The program should stop looping at 0 and not output that value.
I would suggest using a counter to count how many items have been printed out and then after 10 items, print a new line character and then reset the counter.

important: Your output should use " %3d " for exact spacing and a space before and after each number that is output with newlines in order to test correctly.

Ex: If the input is: 10
the output is: 10 9 8 7 6 5 4 3 2 1

Ex: If the input is: 20
the output is: 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

For coding simplicity, follow each output number by a space, even the last one. statement.

Use a while loop. You will need to use an if statement and some sort of decremented variable in your loop.

The skeleton code given in C programming:

#include

int main(void) {
int userNum = 0;
int counter = 0;
printf("Enter a number between 10 and 100:\n");
scanf("%d", &userNum);
if (userNum >= 10 && userNum <=100)
{
while( )
{
/* your code here */
}
}
printf("\n");

return 0;
Computers and Technology
1 answer:
kumpel [21]3 years ago
7 0

Answer:

Program to perform above

Explanation:

#include <stdio.h>

int main() {

   int userNum = 0;

   int counter = 0;

   printf("Enter a number between 10 and 100:\n");

   scanf("%d", &userNum);

   if (userNum >= 10 && userNum <=100)

       {

       while(userNum > 0)

           {

               printf("%d\n", userNum);

               userNum--;

               

           }

       } else

       {

           printf("Number is out of range");

       }

printf("\n");

   

   return 0;

}

You might be interested in
Está dentro del gabinete del CPU es electrónica y hace que la transferencia de datos se realice contra gran rapidez / ayuda vien
Damm [24]

Answer:

no podras poner una foto de la pregunta para Verla y poder ayudarte

5 0
3 years ago
Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the arr
Mila [183]

Answer:

c. The pivot could be either 7 or 9.

Explanation:

Since we are trying to sort an array of eight integers using quick sort, from the first partitioning it shows that the pivot or the central point can either be 7 or 9. When you look at the array, it is only 7 and 9 that are placed correctly in the sorted array. Every element to the left of 7 and 9 are smaller and every element on the right of 7 and 9 are integers higher than them. Hence this shows that the pivot lies between 7 or 9.

6 0
3 years ago
What is the difference between information poor and information rich<br>​
maw [93]

Answer:

The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.

Explanation:

6 0
3 years ago
What will be the output of following python code? a,b=3,4 a,b,c=b,a+3,b-1 print(a,b,c)​
Novosadov [1.4K]

Answer:

6 3 4

Explanation:

A=3+3

b=4-1

c=b=4

6 0
3 years ago
All of the following statements correctly describe an advantage or disadvantage associated with the use of Monte Carlo Analysis
Ahat [919]

Answer:

The correct answer is letter "D": Monte Carlo simulations do not consider risks.

Explanation:

The Monte Carlo analysis is a risk management study that allows identifying different outcomes and possibilities of carrying out a project. It is useful at the moment of determining the project costs and the estimated time it will take to complete the plan. Besides, the Monte Carlo analysis uses quantitative data to compute its calculations which ensures to provide more accurate information and minimizes ambiguity in project schedules and costs.

5 0
4 years ago
Other questions:
  • The network board in a workstation is currently configured as follows:- network speed = auto- duplexing = autoThe workstation is
    13·2 answers
  • You are boating on a lake. the weather turns bad. what should all passengers do first?
    14·2 answers
  • Arpanet was developed by the united states so that there was a communication network that would survive a nuclear war. True or F
    11·1 answer
  • Explain the difference between an Internet draft and a proposed standard
    11·2 answers
  • Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
    8·2 answers
  • Jimmy wrote the procedure scoreToGrade which accepts as a parameter score - a quiz score in the range 0-100. The procedure is su
    8·1 answer
  • describe what measures should have been taken by the educational service and test preparation provider to avoid the security bre
    11·1 answer
  • A) Importance of Software Engineering I​
    5·1 answer
  • Your connection to this site is not secure how to fix.
    15·1 answer
  • Which workbook view is used most often in Excel?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!