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
From a database point of view, the collection of data becomes meaningful only when it reflect
Ne4ueva [31]
From a database point of view,the collection of data becomes meaningful only when it reflects properly defined

Business rules- True business rules must be rendered in writing.
7 0
3 years ago
In what Career Cluster you get to design, build, and destroy things
vaieri [72.5K]

Answer: Architecture

Explanation:

A career cluster can be defined as the group of careers in which professionals are related to common features or occupational tasks are related based on the common features. One person in a career cluster may like more than one job profiles in the same career cluster.

In architecture a person may like to design, build and destroy things to redesign them again. This involves knowledge, skills, mental and physical labor. Building and road constructions are the tasks performed by the architectures.

7 0
3 years ago
A _________ provides multiple ports for connecting nodes and is aware of the exact address or identity of all the nodes attached
Novosadov [1.4K]
The word you are looking for is "hub".
5 0
3 years ago
Read 2 more answers
Which network topology requires terminators at the ends of the backbone cable?
navik [9.2K]
In the 1980's, <span>10BASE2 ethernet networks required termination with a 50ohm resistor at either end. The computers were all connected to this long cable with T-junctions. This is a bus topology.</span>
7 0
3 years ago
You are working from home and want to discuss a controversial topic. It is important you see the facial expressions of your cowo
k0ka [10]

Answer:

Maintaing Focus and keeping the meeting comfortable and moving.

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which best describes a computer bug? A piece of computer hardware that is out of date or has a newer version a piece of computer
    14·2 answers
  • .exe, .msi, .msp, .inf - together, what do these filetypes indicate
    12·2 answers
  • Which of the following should you do first when planning your career
    11·1 answer
  • The person who Oversee the direct work of employees and is responsible for the day-to-day tasks the employees complete is likely
    7·2 answers
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • Write a program that uses these bounds and bisection search (for more info check out the Wikipedia page on bisection search) to
    8·1 answer
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • What techniques can be used to assess a product?
    12·2 answers
  • Write a C console application that will be used to determine if rectangular packages can fit inside one of a set of spheres. You
    5·1 answer
  • True/false questions are useful in determining a student’s ability to____information
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!