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
How are &lt; embed &gt; tags used in web page creation?
yKpoI14uk [10]

Answer:

The <embed> HTML element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.

Explanation:

7 0
2 years ago
Your company is trying to get out of the responsibility of purchasing and hosting its own hardware so it won’t have to finance o
kotykmax [81]
The answer is Software as a Service (SaaS).

SaaS is one of the 3 main categories of cloud computing. In SaaS, a 3rd party provider hosts applications and make them available to customers over the internet. It removes the need for businesses to install and run applications on their own data centers or computers. It also eliminates the expense of hardware acquisition and maintenance, as well as software installation and support.
7 0
3 years ago
Read 2 more answers
Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
Rzqust [24]

Answer: Linked cell

Explanation: I just did a test

7 0
3 years ago
On the basic of size, in how many groups do we classify the computers? Name them.<br>.​
Vedmedyk [2.9K]

Answer:

Computer can be classified into four categories based on size namely Micro, Mini, Mainframe and Super computer

Explanation:

8 0
3 years ago
Taylor develops a prototype for a new smartphone. It only includes code, a way to process the input, a memory card, and a microp
marysya [2.9K]

Answer:

i would say C.output

Explanation:

the program would be the code, the input would be the input, and the memory card would be the memory leaving the output as the only thing forgotten.

6 0
3 years ago
Read 2 more answers
Other questions:
  • The base class Pet has private fields petName, and petAge. The derived class Dog extends the Pet class and includes a private fi
    6·1 answer
  • For a loop counter, the appropriate data type would be:
    14·1 answer
  • Which term describes the process by which light passes through an object or a medium.
    7·2 answers
  • How do you change between worksheets inside an excel workbook?
    13·2 answers
  • How does technology improve convenience, but impact our privacy?
    8·1 answer
  • The latest form of personal communication that most resembles a public journal is a _____.
    15·2 answers
  • NoSQL is a programming language used to create mobile apps.<br> a) True<br> b) False
    13·2 answers
  • How do you know where the home row of the keyboard is?
    14·2 answers
  • Who is the first British in Europe ​
    10·1 answer
  • Question #1
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!