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
nordsb [41]
3 years ago
12

Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and s

topping when both output digits are identical. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 Ex: If the input is: 77 the output is: 77 Ex: If the input is: 15 or any number not between 20 and 98 (inclusive), the output is:
Computers and Technology
1 answer:
S_A_V [24]3 years ago
7 0

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

int main() {

//  variable  

int num;

cout<<"Enter the number between 20 and 98: ";

// read number

cin >> num;

while(num<20||num>98)

{

   cout<<"Wrong input!!enter number between 20-98 only:";

   cin>>num;

}

cout<<"The output is: ";

while(num % 10 != num /10)

{

// print numbers.  

cout<<num<<" ";

// update num.

num--;

}

// display the number.

cout<<num<<endl;;

return 0;

}

Explanation:

Read a number from user and assign it to variable "num".Check if entered number  is in between 20-98 or not.If input number is less than 20 or greater than 98 then  ask again to enter a number between 20-98 until user enter a valid input.Then print  the countdown from input number till both the digit of number are same.

Output:

Enter the number between 20 and 98: 99                                                                                    

Wrong input!!enter number between 20-98 only:12                                                                            

Wrong input!!enter number between 20-98 only:93                                                                            

The output is: 93 92 91 90 89 88

Enter the number between 20 and 98: 77                                                                                    

The output is: 77

You might be interested in
Given a constant named size with a value of 5, which statement can you use to define and initialize an array of doubles named ga
Vinil7 [7]

Answer:

all of the above

7 0
3 years ago
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?
Arte-miy333 [17]
I’m guessing that what’s being looked at here moreso is the space complexity of these algorithms. Heap sort and insertion sort I believe have the lowest of these, but insertion sort is also known to not be the best with time complexity. Therefore heap sort should take the cake
8 0
3 years ago
What explains the discrepancy between the number of bytes you can
sergejj [24]

Answer:

This is because, the advertisers report the storage space in decimal while the computer reads the storage space in binary.

Explanation:

The advertisers report the storage space in decimal or base 10 because humans count in decimal, whereas the computer reports the storage space in binary or base 2.

Since the computer storage is in bytes and 8 bits equal 1 byte, It is easier to write a storage space of 1 kB as 1000 B but it is actually supposed to be 1024 B(2¹⁰). So, there is a discrepancy of 1024 B - 1000 B = 24 B.

As  we go higher, the discrepancy increases. For example, 1 MB is advertised as 1000 kB = 1000000 B but is actually supposed to be 1024 kB = 1024 × 1024 B = 1048576 B. So, there is a discrepancy of 1048576 B - 1000000 B = 48576 B.

So, the actual number of bytes on the storage device is actually less than that reported due to the different number systems in which they are reported in. This discrepancy is less in memory cards or flash drives though in which the stated value of storage capacity might be the actual storage size.

Note that the base 10 or decimal system was chosen by advertiser since this is what consumers understand.

8 0
2 years ago
A look to different section of the same page is known as_____.
11Alexandr11 [23.1K]

Answer:

hatdoggggggggg

Explanation:

sunoggggggg

6 0
2 years ago
Match the elements of a web page with their descriptions?
enyata [817]
The last one is audio, the third one is animation and the first one is graphics so
5 0
2 years ago
Read 2 more answers
Other questions:
  • The one place where c++ allows aggregate operations on arrays is the input and output of c-strings.
    8·1 answer
  • Write a program that does the following: • Alphabetizes a list of small (non-capital) letters. For consistency, make the string
    14·1 answer
  • J. A computer on a network that acts as the central storage location for
    5·1 answer
  • Vicky is investigating multiple hacking attempts on her cloud-based e-commerce web servers. She wants to add a front-end securit
    5·1 answer
  • Write a python program that requests a positive integer from the user, determines if it is a composite, a prime or neither prime
    8·1 answer
  • How to find out what windows version i have?
    10·1 answer
  • What are the services offered by web-based email?​
    12·1 answer
  • Which of the following is not the disadvantage of closed
    7·2 answers
  • How do you enlarge an image to see more detail on it? (1 point)
    14·2 answers
  • an existing technology that would allow users to transfer images from the camera to the computer without connecting them
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!