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
Christina has been asked by the firewall administration group to identify secure network protocols that can be used to prevent n
kotegsom [21]

Answer:

SSH, HTTPS and SMTP

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, etc.

Encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext. Once, an information or data has been encrypted it can only be accessed and deciphered by an authorized user.

Some examples of encryption algorithms are 3DES, AES, RC4, RC5, and RSA.

Hence, SSH, HTTPS and SMTP are considered as secure network protocols.

HTTPS is acronym for Hypertext Transfer Protocol Secure while SSL is acronym for Secure Sockets Layer (SSL).

SMTP is an acronym for Simple Mail Transfer Protocol and it uses the standard port number of 25 to provide clients with requested services.

6 0
3 years ago
List 1 reason people invest in Cryptocurrency
Katarina [22]

Answer:

The common reason to invest in cryptocurrency is the desire for a reliable, long-term store of value.

Explanation:

8 0
2 years ago
By limiting the number of times a person can use a type of software before registering as the authorized owner of that software,
alexira [117]

Answer:

Software piracy.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

Simply stated, it's a computer program or application that comprises of sets of code for performing specific tasks on the system.

Basically, softwares are categorized into two (2) main categories and these are;

I. Open-source software.

II. Proprietary software.

A proprietary software is also known as a closed-source software and it can be defined as any software application or program that has its source code copyrighted and as such cannot be used, modified or distributed without authorization from the software developer. Thus, it is typically published as a commercial software that may be sold, licensed or leased by the software developer (vendor) to the end users with terms and conditions.

Some examples of proprietary software are Microsoft Windows, macOS, Adobe photoshop etc.

Furthermore, a proprietary software license avail end users the opportunity to install and use the software after agreeing to the terms of its license.

Software piracy can be defined as an act which typically involves the unauthorized use, duplications, or distribution of a software that is legally copyrighted or protected, without an express permission from the software manufacturer (owner).

Generally, software manufacturers (owners) deal with problems associated with software piracy by placing a limit on the number of times or durations that an end user is allowed to use a particular software before registering (subscribing) as the authorized owner of that software.

8 0
2 years ago
Why do we need the system requirements for Adobe photoshop?
babymother [125]
I’m sorry and I do not know I just need credits thank have a nice day
7 0
3 years ago
You manage a network that uses a single switch. All ports within your building connect through the single switch. In the lobby o
Karo-lina-s [1.5K]

Answer:

<u>VLANs</u>

Explanation:

Virtual LANs (VLANs) are a type of network connection or arrangement of network devices in the same broadcast domain. They are called Virtual LANs because they represent fractions or subgroups in the switch ports found in an Ethernet LAN.

Indeed, because of their topological arrangement, this reduces the security risk of unauthorized access to sensitive data or devices since the host can be placed on a different VLAN. Hence, in this scenario, using this network feature would allow visitors to plug into these ports to gain internet access, but they would not have access to any other devices on the private network.

5 0
2 years ago
Other questions:
  • Why does this say I'm in middle school?
    11·1 answer
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Which of the following has allowed computers to have more memory capabilities without making them extremely expensive Virtual me
    9·1 answer
  • An ideal line length would include how many characters? A. 6570 B. 100 C. 100125 D. 4055
    8·1 answer
  • Write a Python program that reads the CSV file, compares the population estimates of every row for 2010 and 2017 and computes th
    10·1 answer
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • Write an expression to print each price in stock_prices. Sample output with inputs: 34.62 76.30 85.05
    9·1 answer
  • Data-as-a-service began with the notion that data quality could happen in a centralized place, cleansing and enriching data and
    7·1 answer
  • What is the use of jacquard loom
    13·2 answers
  • What is the first step that you have to perform before you can add a windows package to a wim file?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!