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]
2 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]2 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
Use of multimedia in business sector...​?
jeyben [28]

Answer:

Advertisement or Marketing

Explanation:

Most products are marketed or advertised through the use of multimedia content such as videos and pictures.

6 0
2 years ago
Let x = ["Red", 2.55,"Green", 3,"Black","false"], then solve the following:
blagie [28]

Answer:

  • Print(x) would be directly calling the x variable so it would print everything but the []
  • Print(x[10]) is calling the number 10 which results in E
  • 2 + d= 2d

3 0
2 years ago
Select the statement that best describes the function of the cell wall. O it gives shape to plants cells. O it produces food fro
Maslowich
It’s jelly like fluid surrounds the nucleus
8 0
2 years ago
Velma is graduating from Ashford at the end of next year. After she completes her final class, she will reward herself for her h
motikmotik

This question is incomplete because the options are missing; here are the options for this question:

Which of the following is the most effective way for Velma to save money each month?

A. Automatically reroute a portion of her paycheck to her savings account.

B. Manually deposit 10% of her paycheck in her savings account.

C. Pay all of her bills and then place the remaining money in her savings account.

D. Pay all of her bills and then place the remaining money in her piggy bank.

The correct answer to this question is A. Automatically reroute a portion of her paycheck to her savings account.

Explanation:

In this case, Velma needs to consistently save money for her vacation as this guarantees she will have the money for the trip. This means it is ideal every month she contributes consistently to her savings for the vacation.

This can be better be achieved by automatically rerouting a part of her paycheck for this purpose (Option A) because in this way, every month the money for the vacations will increase and the amount of money will be consistent, which means Velma will know beforehand the money she will have for the vacation. Moreover, options such as using a piggy bank or paying the bills and using the rest for her savings, do not guarantee she will contribute to the savings every month, or she will have the money she needs at the end.

5 0
3 years ago
Countries need to engage in trade of natural resources because of distribution in the earth. For instance, countries such as Sau
maks197457 [2]
Water is a scarcity in this area
4 0
2 years ago
Other questions:
  • Pete Jones, a bait shop owner, incorporates ______ within a webpage to entice customers to buy a new lure.
    7·1 answer
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    7·1 answer
  • What does CPL stand for
    9·2 answers
  • In a computerized accounting system, each transaction that is analyzed must be entered by hand into the appropriate journal and
    12·2 answers
  • Which key is used in word processors to create indentations?
    13·2 answers
  • Why does my Office Computer send packet #1? What device responds by sending back packet #2? What information does my Office Comp
    15·1 answer
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • How many types of sharing of Google Forms are possible?
    15·1 answer
  • What is the difference between skew and rotate in the MS Paint application?
    14·2 answers
  • A student can improve performance by decreasing
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!