answer.
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]
2 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]2 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
Identifying Characters
alina1380 [7]
The answer is d I just took the test
5 0
2 years ago
Read 2 more answers
What term describes one or more characters following the last period in a filename, such as .exe, .txt, or .avi?
elixir [45]

Answer:

Explanation:

.exe: is a file extension, means file that contain executable program which can be run by Microsoft windows.

.txt: is also file extension which contains text (characters).

.avi: means (audio video interleave) is a file extension, which contains audio and video data encoded.

3 0
2 years ago
Emulated drivers provide enhanced drivers for the guest OS and improve performance and functionality for IDE and SCSI storage de
Vikki [24]

Answer:

The answer is "Option 2".

Explanation:

  • All the other drivers replicate even existing technical embedded devices. These systems have optimistic, and they are commonly accessible to inbox operators as most web browsers. It is an Imitated device, that performance problems because of all the emulator is the workload.
  • Integration Services  is a program package, which is created on a guest OS of a VM, that provides enhanced guest OS drivers and improves accuracy, functionality for IDE and SCSI storage systems, networking interfaces, and monitor and multimedia devices, that's why it is incorrect.

8 0
2 years ago
Which sentence describes a task on which a genetic engineer is most likely to work?
galina1969 [7]

Answer:

C

Explanation:

If you look at the picture, you will see why it is C. It says D, but the multiple choices are differently ordered and it is kind of differently worded.

But in conclusion, the answer is C.

5 0
2 years ago
Read 2 more answers
You are modeling a small part of an online flight reservation system, according to the following description. A flight is a sing
Law Incorporation [45]

Answer:

Explanation:

The database schema can have following tables:

1. airport_table(apcode, apcity, apcountry)

2. airline_table(aid, aname, acountry)

3. flight_table(fid, aid, arrtime, depttime)

4. passenger_table(pid, pname, pcity, pcountry)

5 booking_table(bid, bdate, pid)

See attachment for the diagram

4 0
2 years ago
Other questions:
  • Allows you to manually add an entry to the arp cache that resolves the ip address inetaddr to the physical address etheraddr. wh
    13·1 answer
  • Ivan has five workbooks open. He has arranged these files in a specific grouping so he can view them at the same time. In order
    10·1 answer
  • Jesse would like to modify the table that he has inserted into a Word document by making the first row a single header cell.
    15·2 answers
  • Write a class Student() such that it has an attribute 'score' (that is initialized with 10) and three methods: add_score(): adds
    12·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    13·1 answer
  • Write code that determines the number of full days represented by the number of hours stored in the variable hours and stores th
    15·1 answer
  • given the numerical value 1010101.11, which of the following number systems is most likely represented.
    11·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • I have a variable and set it equal to 5. 1 then send it as an argument to a function that adds 5 to the variable passed in. Outs
    9·1 answer
  • Plz help code practice for python
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!