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]
3 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]3 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
The Gramm-Leach-Bliley Act contains a rule that ensures security and confidentiality of customer information, protects against a
ValentinkaMS [17]

Answer:

b. The Safeguards Rule

Explanation:

According to a different source, these are the options that come with this question:

a. The Information Assurance Rule

b. The Safeguards Rule

c. The Safety Rule

d. The Guardian Rule

This rule is called the <em>Safeguards Rule</em>, and it comes from the Gramm–Leach–Bliley Act (GLBA), also known as the Financial Services Modernization Act of 1999. This is an act of Congress signed by President Bill Clinton that removed barriers among banking companies, securities companies and insurance companies. This meant that organizations such as commercial banks, investment banks, securities firms, and insurance companies were able to consolidate.

7 0
3 years ago
Read 2 more answers
A high school teacher conducted a test of a new approach to teaching math. Students were given a pretest when their math class b
MakcuM [25]

Answer:

It represents a threat of instrument change.

Explanation:

Internal validity is a method to determine if research has been performed properly. It is based on the number of confounding variables present in the experiment. If an experiment is carried out and confounding variables are avoided, the internal validity is high, and viceversa. In an ideal context, the experiment's internal validity will be high, which will mean its results will be trustworthy.

The students, by making use of a computer software, lowered the validity of the test performed by the teacher.

5 0
3 years ago
I NEED HELP ASAP IM BAD AT THIS
ra1l [238]

A float is a floating point number. This means that's the number has a decimal place. Numbers with or without decimal places can be stored in a float variable but more commonly numbers with decimal points.

The correct choices are 1 and 3.4

4 0
3 years ago
The ____ property configures a shadow effect on the text displayed within an element
Bogdan [553]
Shareder Is the answer I put. 
3 0
3 years ago
How to build a 5*32 decoder by using 3*8 and 2*4 decoders? (digital design)
GuDViN [60]
Depends if your encoder has ENABLE input..
if so see my attached image.
sorry for the messy schema
7 0
3 years ago
Other questions:
  • What is the use of pecil icon
    11·2 answers
  • How can touch typing quickly but accurately improve your earnings (the money you can make)
    15·2 answers
  • Binary is best interpreted by a computer because?
    8·2 answers
  • Identify the false statement.
    8·1 answer
  • Which facet of the 4e framework is best addressed by thought-sharing sites?
    14·1 answer
  • Which of the following is NOT a strength of monetary policy?
    15·1 answer
  • A _____ miniature battery operated transmitter that can be propelled through a non-metallic pipe or purpose of locating
    6·1 answer
  • To save your new document or presentation, click the Start Button
    10·1 answer
  • Technician A says that volatility describes how hard it is for gasoline to evaporate. Technician B says that Reid vapor pressure
    8·1 answer
  • Which of the following is NOT one of the three main ways to control a program when writing code?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!