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
shtirl [24]
2 years ago
15

Countdown until matching digits Write a program that takes in an integer in the range 11-100 as input. The output is a countdown

starting from the integer, and stopping when both output digits are identical. Ex: If the input is the output is 93 92 91 90 89 88 Ex: If the input is 11 the output is 11 Ex: If the input is 9 or any number not between 11 and 100 (inclusive), the output is: Input must be 11-100 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits do not write a large if-else for all possible same-digit numbers (11,22,33...99), as that approach would be cumbersome for larger ranges. 29999.1122120 LAB ACTIVITY 4.13.1: LAB: Countdown until matching digits 7/10 main.c Load default template... 1 include 2 3 int main() 4 int n, i: 5 scanf("%d", &n); if (n < 20 Il n98) { 7 printf("%d",n); } else { i-n: 1e while (1) printf("%d", 1); if (icie - i/10) 13 14 15 16 17 } 18 printf("\n"); 19 return : 20 ) 12 break; Latest submission - 11:16 PM on 02/05/21 Total score: 7/10 Only show failing tests Download this submission 1: Compare output A 3/3 Input Your output 93 92 91 90 89 88 2: Compare Output A Input 11 Your output 11 3: Compare output a 3/3 Input 20 Your output 20 19 18 17 16 15 14 13 12 11 4: Compare output A 0/2 Output differs. See highlights below. Special character legend Input 101 Your output 101 Expected output Input must be 11-100 5. Compare output A 0/1 Output differs. See highlights below. Special character legend Input Your output Expected output Input must be 11-100
Computers and Technology
1 answer:
Dovator [93]2 years ago
4 0

Answer:

The program in C is as follows:

#include <stdio.h>

int main(){

   int n;

   scanf("%d", &n);

   if(n<11 || n>100){

       printf("Input must be between 11 - 100");    }

   else{

       while(n%11 != 0){

           printf("%d ", n);

           n--;        }

       printf("%d ", n);    }

   return 0;

}

Explanation:

The existing template can not be used. So, I design the program from scratch.

This declares the number n, as integer

   int n;

This gets input for n

   scanf("%d", &n);

This checks if input is within range (11 - 100, inclusive)

   if(n<11 || n>100){

The following prompt is printed if the number is out of range

       printf("Input must be between 11 - 100");    }

   else{

If input is within range, the countdown is printed

       while(n%11 != 0){ ----This checks if the digits are identical using modulus 11

Print the digit

           printf("%d ", n);

Decrement by 1

           n--;        }

This prints the last expected output

       printf("%d ", n);    }

You might be interested in
The ___ appears at the bottom of the windows desktop; it is used to launch and manage programs.
asambeis [7]
<span>The taskbar appears at the bottom of the windows desktop. It is used to launch and manage programs. 
</span>The taskbar is part of the GUI (Graphical User Interface) . The most common uses of the taskbar is to<span> to locate and launch programs through the Start button, to view any program that is currently open, check the date an time.</span>
4 0
2 years ago
PLEASE HELP
DedPeter [7]

online stuff dont ever get permanently erased even if the person or website deletes the  file someone could download it before it is taken down. The internet has so many different websites that it flags that your computer visited them doesn't matter how long.  also cookies evaluate what you viewed on their website and act accordingly. Anyone with good hacking skills can break into any online account or website and use the digital footprint to track you to your scource.

7 0
2 years ago
Which of the following are true about cryptocurrency wallets?
dezoksy [38]

Answer:

Looks like it is a multiple choice question

and you didn't give any choice

5 0
2 years ago
What some one ask me if i am more of hardware or software person, what is that mean?
balu736 [363]

Answer: Any person or people asking about someone being a hardware or software person displays that they are questioning about the computer knowledge of the person and his/her interest.

The interest can be regarding software tools for programming, designing ,  etc or hardware device like troubleshooting, assembling the computer parts ,etc.

The person persisting good knowledge about software programming language and software is diverted towards software side .The person who likes to deal with hardware parts of the computer system is hardware-oriented person.

7 0
2 years ago
1. Describe the sequencing of factors influencing health status codes for patients that also have chronic conditions being manag
Vesnalui [34]
Bubyggyy tvtvtvttfrcrt
4 0
2 years ago
Other questions:
  • Which of the following are valid values of the char data type? (Select all that apply)
    15·2 answers
  • Critics are concerned about how easy it is to upload and download music on the Internet because:
    10·2 answers
  • How might your use of computers and knowledge after technology systems affect your personal and professional success
    5·1 answer
  • What new parts will you need to replace a failing processor?
    15·1 answer
  • What does network administration normally include? Check all of the boxes that apply.
    8·1 answer
  • 9. Which is an example of a function?<br>(1 Point)<br>=A1 +A2<br>=SUM(A1:A3)<br>=ADD(A1:A3)​
    14·2 answers
  • In the last two decades, how have cameras evolved?
    12·2 answers
  • A web application's code prevents the output of any type of information when an error occurs during a request. The development t
    12·1 answer
  • What construction work is the tender for​
    10·2 answers
  • What is the name of the final version of software when all design requirements have been met?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!