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
Alex787 [66]
4 years ago
12

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 cổunt 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. In C please
Computers and Technology
1 answer:
antoniya [11.8K]4 years ago
6 0

Answer:

The program written in C language is as follows

#include<stdio.h>

int main()

{

//Declare digit

int digit;

//Prompt user for input

printf("Enter any integer: [10 - 100]: ");

scanf("%d", &digit);

//Check if digit is within range 10 to 100

while(digit<10 || digit >100)

{

printf("Enter any integer: [10 - 100]: ");

scanf("%d", &digit);

}

//Initialize counter to 0

int counter = 0;

for(int i=digit;i>0;i--)

{

 printf("%3d", i); //Print individual digit

 counter++;

 if(counter == 10) //Check if printed digit is up to 10

 {

  printf("\n"); //If yes, print a new line

  counter=0; //And reset counter to 0

 }

}

}

Explanation:

int digit; ->This line declares digit as type int

printf("Enter any integer: [10 - 100]: "); -> This line prompts user for input

scanf("%d", &digit);-> The input us saved in digit

while(digit<10 || digit >100) {

printf("Enter any integer: [10 - 100]: ");

scanf("%d", &digit); }

->The above lines checks if input number is between 10 and 100

int counter = 0; -> Declare and set a counter variable to 0

for(int i=digit;i>0;i--){ -> Iterate from user input to 0

printf("%3d", i); -> This line prints individual digits with 3 line spacing

counter++; -> This line increments counter by 1

if(counter == 10){-> This line checks if printed digit is up to 10

printf("\n"); -> If yes, a new line is printed

counter=0;} -> Reset counter to 0

} - > End of iteration

You might be interested in
Which agency motors the sale and registration of vehicles and vessels within the state
gogolik [260]

An agency which monitors the sale and registration of vehicles and vessels within the state is the department of highway safety and motor vehicles.

<h3>What is the department of highway safety and motor vehicles?</h3>

The department of highway safety and motor vehicles can be defined as a cabinet agency that is established and saddled with the responsibility of monitoring the sales and registration of automobile vehicles and vessels within the state of Florida in the United States of America.

In 1969, the defunct department of public safety and the department of motor vehicles were merged together under Governor Claude Kirk, as a single agency, which became known as the department of highway safety and motor vehicles

Read more on department of highway safety here: brainly.com/question/4805408

#SPJ1

Complete Question:

Which agency monitors the sale and registration of vehicles and vessels within the state?

6 0
2 years ago
Technicans A says the engine camshaft converts reciprocating motion of the piston into rotary montion for power output. Technici
garri49 [273]

It doesn't say what Technician B thinks, but I can tell you what the camshaft does and then you can decide who is right on your own. The camshaft is little metal rounded triangles above the piston that times when the intake and exhaust valve open and close.

Technician A is very wrong, the camshaft doesn't do that.

6 0
4 years ago
If you are logged on to Windows Live Messenger, why would you be unable to engage
Mazyrski [523]

Answer:

I'm not sure i haven't had that problem

Explanation:

7 0
3 years ago
#include
meriva

Answer:

wait what

Explanation:

6 0
2 years ago
Read 2 more answers
When a class contains a pointer to dynamically allocated memory, it is a good idea to equip the class with?
Valentin [98]

No it is not a good idea, it shouldn’t be memberwise assignment NOT be used when an object contains a pointer to dynamically allocated memory. Class members are private by default, the following describes a class that would be a good candidate for conversion to a template class is a class which defines a new type of array. 

5 0
3 years ago
Other questions:
  • What device copies system files
    14·1 answer
  • Why ues storage unit?​
    12·1 answer
  • What dod regulation governs the use of commercial wireless devices within the global information grid?
    13·1 answer
  • _____ is a computing model in which an organization outsources the equipment used to support its business operations, including
    15·1 answer
  • An insulated anti-short fitting required to be installed in the ends of Type AC cable to protect the wires from abrasion is typi
    13·1 answer
  • You want to substitute one word with another throughout your
    13·1 answer
  • Write a program that will input temperatures for consecutive days. The program will store these values into an array and call a
    9·1 answer
  • How is video compression accomplished?
    14·1 answer
  • Is a mainframe computer portable?​
    10·1 answer
  • Please please help I don’t understand this
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!