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
Tell me at list 5 farm animals dieases​
Vlad [161]
<h3>Answer : </h3>

<em><u>F</u></em><em><u>a</u></em><em><u>r</u></em><em><u>m</u></em><em><u> </u></em><em><u>C</u></em><em><u>o</u></em><em><u>m</u></em><em><u>m</u></em><em><u>o</u></em><em><u>n</u></em><em><u> </u></em><em><u>D</u></em><em><u>i</u></em><em><u>s</u></em><em><u>e</u></em><em><u>a</u></em><em><u>s</u></em><em><u>e</u></em><em><u>s</u></em><em><u> </u></em><em><u>:</u></em><em><u> </u></em>

<em><u>.</u></em><em><u> </u></em><em><u>General Farm Animal Diseases.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Avian Influenza.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Bovine Spongiform Encephalopathy (BSE)</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Foot-and-Mouth Disease.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>West Nile Virus.</u></em>

Explanation:

<em><u>H</u></em><em><u>o</u></em><em><u>p</u></em><em><u>e</u></em><em><u> </u></em><em><u>i</u></em><em><u>t</u></em><em><u> </u></em><em><u>h</u></em><em><u>e</u></em><em><u>l</u></em><em><u>p</u></em><em><u>s</u></em><em><u> </u></em><em><u>o</u></em><em><u>u</u></em><em><u>t</u></em><em><u> </u></em><em><u>:</u></em><em><u>)</u></em><em><u>)</u></em>

7 0
3 years ago
Read 2 more answers
What is the difference, if any, between secure HTTP and firewalls?
Jobisdone [24]

Answer:

SSL would simply encrypt whatever request is sent to the server. In order to prevent the execution of such malicious scripts/payloads at the Web application (in other words the Web server), a Web Application Firewall is implemented in place. ... Whereas, HTTPS where SSL comes into picture would have methods such as POST.

in other words its A

5 0
3 years ago
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin &gt;&gt; one &gt;
SSSSS [86.1K]

Answer:

variable one stores 10.5 and two stores 30.6

Explanation:

In c++ language, the cout keyword is used to write to the standard output. The input from the user is taken by using the cin keyword.

For the input from the user, a variable need is declared first.

datatype variable_name;

The input can be taken one at a time as shown.

cin >> variable_name;

The input for more than one variable can be taken in a single line as given by the syntax below.

1. First, two variables are declared.

datatype variable_name1, variable_name2;

2. Both input is taken simultaneously as shown.

cin >> variable_name1, variable_name2;

For the given scenario, two double variables are declared as below.

double one, two;

The question mentions input values for the two double variables as 10.5 and 30.6.

3. The given scenario takes both the values as input at the same time, in a single line as shown below.

cin >> one >> two;

4. After this statement, both the values entered by the user are accepted.

The values should be separated by space.

First value is stored in the variable one.

Second value is stored in the variable two.

5. The user enters the values as follows.

10.5 30.6

6. The value 10.5 is stored in variable one.

7. The value 30.6 is stored in variable two.

The c++ program to implement the above is given below.

#include <iostream>

using namespace std;

int main() {

   double one, two;      

   cout << " Enter two decimal values " << endl;

   cin >> one >> two;

   cout << " The input values are " << endl;

   cout << " one : " << one << " \t " << " two : " << two << endl;

   return 0;

}

OUTPUT

Enter two decimal values  

10.5 30.6

The input values are  

one : 10    two : 530.6

6 0
3 years ago
Explain the role of ICT in banks​
vladimir1956 [14]

Answer: ICT help banks improve the efficiency and effectiveness of services offered to customers, and enhances business processes, managerial decision making, and workgroup collaborations, which strengthens their competitive positions in rapidly changing and emerging economies.

Explanation: please give branliest I only need one more to make ace

7 0
2 years ago
What do u do to me pepa
Maru [420]
Peppa: Hello Susie!

Susie: *mehhh* Hello Peppa!
What are you doing?
Peppa: I'm learning to whistle,

but I can't do it yet.
Susie: Hmm.. that sounds hard.
Peppa: It's impossible!
Uh.. can you whistle Susie?
Susie: No

Peppa: *honk* Oh good! I mean-
that's sad if you can't whistle

but good because I can't whistle

Susie: What's whistling anyway?
Peppa: You put your lips together
and blow!
Susie: Like this? *whistles*
8 0
2 years ago
Other questions:
  • In the 2007/2010 version of Paint, which of the following tools are located in the View tab? (Select all that apply.)
    5·1 answer
  • What is data security
    14·1 answer
  • How many hosts are in each subnet?
    15·1 answer
  • The marketplace is the essence of which of the following?
    11·1 answer
  • State all the generations of computers.
    10·2 answers
  • Brainliest for whoever adds me on snap<br> gianavaughn007
    15·2 answers
  • How can you rotate and resize your drawing?​
    9·2 answers
  • Which logic correctly describes an algorithm to find the smallest of the three numbers a, b, and c and store the smallest number
    15·1 answer
  • Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
    5·1 answer
  • Over the last decade, the overall energy consumption of cloud data centers worldwide has remained relatively the same. Why is th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!