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
You must regularly do this on your computer to prevent a virus from infecting it​
Alekssandra [29.7K]

Answer; Install Anti-Virus/Malware Software. ...

Keep Your Anti-Virus Software Up to Date. ...

Run Regularly Scheduled Scans with Your Anti-Virus Software. ...

Keep Your Operating System Current. ...

Secure Your Network. ...

Think Before You Click.

Explanation:

i took the test

5 0
3 years ago
Read 2 more answers
Which country began expanding its borders with exploration in the late 16th<br>century?​
Lapatulllka [165]

Answer:

England began expanding its border with exploration in the late 16th century.

Explanation:

During the age of discovery, which is a period of exploracion protracted from 15th century to 16th century, different overseas travels were carried out in order to explore and that resulted in the appropiation of other lands.  England, France, and the Netherlands began to establish colonies and trade networks of their own in the Americas and Asia.

8 0
3 years ago
After you create a pie chart, you can move it to its own chart sheet.
katen-ka-za [31]

Answer:

I think it's either true or false

Explanation:

5 0
3 years ago
Helpppppp meeeeeeeeeeeeeeeeee
nikitadnepr [17]
My throat crazyyyyyyy










-xoxoxo
7 0
3 years ago
Hi there. I need to know that if I take computer fundamentals, will that class teach anything about graphic design or digital de
Vedmedyk [2.9K]
Hi there!

I have taken a computer fundamentals class before and they did skim over the topic, but they did not go into depth on it at all. If you really want to learn about that stuff I suggest you find a course that is specifically on that topic or something that is closer related then a general <span>computer fundamentals course.

-Your friend in tech,
</span>ASIAX <span>  </span><span>Frequent Answerer</span>
8 0
3 years ago
Other questions:
  • If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
    10·1 answer
  • Universal containers has included its orders as an external data object in to Salesforce. You want to create a relationship betw
    7·1 answer
  • Simplify (6x+6)+(-3-4x) please hurry!!!!!
    6·1 answer
  • When viewing data entered into a spreadsheet, the columns identify _____.?
    5·1 answer
  • alguem por favor poderia me falar que jogo sera mais pesado tanto em qualidades graficas ou em tudo:dragons dogma dark arisen ou
    11·1 answer
  • How to get the home button on your screen?
    13·1 answer
  • _____ is the measure of a system’s ability to expand, change, or downsize easily to meet the changing needs of a business enterp
    11·1 answer
  • Given two integer arrays, largerArray with 4 elements, and smallerArray with 3 elements. What is the result after this code exec
    7·1 answer
  • Which of the following is a tip for making sure you are messaging safely?
    5·1 answer
  • A _____ shows how data moves through an information system but does not show program logic or processing steps.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!