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]
3 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]3 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
What is the range of values that a short can represent?
ikadub [295]

Answer:

c. Math.pow(-2.0,15.0) to (Math.pow(2.0,15.0) -1).

Explanation:

short represents a 16-bit signed integer. short is used to save memory because it occupies less space than integers where integers occupy 4 bytes short occupies 2 bytes.

Since it is signed so first bit is used to represent the sign if 0 then positive and 1 then the integer is negative.We are left with 15 bits.

So the range is -2¹⁵ to 2¹⁵-1.

Hence the answer is option c.

3 0
2 years ago
A species of snake lives in a rainforest. Which would be an adaptation for this
raketka [301]

Answer:

The Answer is D

6 0
3 years ago
Read 2 more answers
Which of the following is true about a hot site?
swat32

Answer:

Option(d) is the correct answer to the given question.

Explanation:

A hot site is a place off site in which the task of a corporation could restart during a massive failure.The hot site seems to have all the needed equipment for such the corporation to schedule the normal activities, such as phone jacks, replacement data, laptops, and linked devices.

  • The main objective of hot sites provide an useful backup mechanism for any corporation that wishes to pursue its business in the presence of exceptional circumstances or events.
  • All the others options are not related to hot site that's why they are incorrect option.
8 0
3 years ago
You typed the word "weather" when you meant to type the word "whether. " When will Writer or Word flag this as a misspelling or
Alenkasestr [34]

The word flag shows misspelling while typing word "weather" instead of "whether"  is depends on the rest of the sentence and how you have your settings for grammar and spell checker.

<h3>What is word flag or spell checker?</h3>

Word flag or spell checker is the tool or software which helps to identify the misspelling or a grammar problem while typing.

The word "weather"  is typed when there was  to type the word "whether. "

Now, before checking that, when will Writer or Word flag this as a misspelling or a grammar problem, first we have to understand the meaning of both the word.

Word "weather"  is the state of atmosphere for different conditions of temperature, pressure, and humanity. While the word "whether " is the expression of confusion between two things.

The option given for this problem are,

  • Depends on the rest of the sentence and how you have your settings for grammar and spell checker
  • Never
  • All the time.

Word flag, tells the incorrect word, spelling or grammatical error in a sentence.

To identify a particular word which is misplaced in place of another almost similar spelled word, it checks the other word and sentence.

If the particular word does not match with the sentence, the  word flag or spell checker shows the error.

Hence, the word flag shows misspelling while typing word "weather" instead of "whether"  is depends on the rest of the sentence and how you have your settings for grammar and spell checker.

Learn more about the spell checker here;

brainly.com/question/515655

6 0
2 years ago
Match the image to its type.
boyakko [2]

Warm Colors:

  • <em>Red</em> flowers
  • Oranges

Cool Colors:

  • <em>Blue </em>skies
  • <em>Purple</em> butterflies

Neutral Colors:

  • <em>Brown</em> wood
  • <em>White</em> birds

Reds, oranges, and yellows are considered warm, and greens, teals, blues, and purples are considered cool. Colors such as white, black, brown, or gray are all neutral.

3 0
2 years ago
Other questions:
  • Communications technology and the Internet can be used to reduce the time and costs involved in disseminating financial statemen
    14·1 answer
  • Our readings so far explored computer hardware and software, in particular operating systems and application software. There are
    11·1 answer
  • All of the following are advantages of database-stored information, except ______________. Multiple Choice
    7·1 answer
  • Declare a variable temperature and initialize it to 98.6. Instructor Notes: Note that "initialize" means "declare and assign a v
    5·1 answer
  • Translate We get up at 8 o'clock into Spanish in the box below:​
    9·1 answer
  • Every command or instruction is called
    8·2 answers
  • Write a short note on Computer<br>impact on<br> our society?​
    7·2 answers
  • Describe all the steps a router goes through while deciding where to send the a packet. Explain why a router would choose one ro
    7·1 answer
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as t
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!