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
You have two DCs, each with three Active Directory-integrated zones. You're getting inconsistent DNS lookup results and suspect
nikklg [1K]

Since their or two domain controller and where their or three active directory is associates.

  • As first check the tcpip ranges to be checked if both falls on same tcpip address. Better to change the one from tcpip address.
  • Second is host and subdomain has to checked and reconfigure if necessary.
  • Computer name and connected their group to be checked.
  • With NSLOOKUP command from disk operation system come check ping tracking reply is positive or negative.

When we query for DNS, end user need to see the positive reply from list of servers. Possible for scanning the IPV6 address across the domains and find as positive or negative response. End user has to decide the primary and secondary domain controller’s

Normally secondary domain controller’s as to be configured as standard alone. On success on deciding primary and secondary domain controller’s automate the process from primary to secondary by configuration with ns records. Possible for domain partition also.

8 0
3 years ago
A banded table appears with
Triss [41]

Answer:

banded rows and banded columns with alternate rows and columns in different colors and shades.

And hence, A different shading colors for odd even rows.

Explanation:

Suppose you have a plenty of data in a spreadsheet. It has been found that if the rows and columns are being shown through color banding, then they look quite pleasant to our eyes. And the options for the columns and rows banding  helps us in developing bands that are formed alternatively, and one being colored and the other being shaded. And all these are rows and columns. So we have banded rows and banded columns. And you can make this by converting the sheet to table, and then using the table style.

7 0
4 years ago
The undo function allows the user to cancel up to _____ previous typing actions
valina [46]
It can cancel up to 40 times.
4 0
4 years ago
Read 2 more answers
Why do you need to cite your sources? (check all that apply)
Shalnov [3]

the answer to this is  2 and 3

Hope this helped

-scav

4 0
3 years ago
What information does a Transform hold? (Choose all that apply)
never [62]

Answer:

Each object stores its position, orientation, and scale values.

Explanation:

5 0
4 years ago
Other questions:
  • What is the name of the subsystem that transfers data between components inside a pc or between pcs?
    12·1 answer
  • What happens if the cursor is in the last cell in a table and you press Tab?
    10·1 answer
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • Computer-aided manufacturing (CAM) offers which possible benefits?
    15·2 answers
  • Write the name of the tab, the command group, and the icon that you need to use to justify
    14·1 answer
  • InJava garbage collection is done by_______________JVM (Java VirtualMachine)ProgrammerBoth JVM (Java Virtual Machine)and Program
    9·1 answer
  • Who here has a crush on jk from bts but feels more mature than him
    10·2 answers
  • (2) What isa<br>LAN and what the<br>devices required in<br>setting up<br>LAN?​
    8·1 answer
  • Que es un proyecto técnico?
    9·2 answers
  • Meryl works in the audio-video department
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!