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
Assume that ip has been declared to be a pointer to int and that enrollment has been declared to be an array of 20 elements . As
Vitek1552 [10]

Answer:

ip = enrollment + section;

Explanation:

The variable ip has been declared to be a pointer to int.

int * ip;

The variable enrollment has been declared as an array of 20 elements .

int enrollment[20];

The variable section has been declared as an int.

int section;

In order to make ip point to the element in the array indexed by section, we can use the following statement :

ip = enrollment + section;

This will make ip point to enrollment[section].

5 0
2 years ago
Cuando hablamos de entornos digitales de enseñanza aprendizaje a que nos estamos refiriendo
olga2289 [7]

Answer:

Al hablar de entornos digitales de enseñanza y aprendizaje, la frase apunta al avenimiento de medios informáticos y tecnológicos al proceso metodológico de enseñanza de los distintos sistemas educativos a nivel mundial.

Así, la irrupción del internet como medio de búsqueda de información y las herramientas digitales como vídeos, diapositivas y libros electrónicos como métodos de presentación de información han facilitado el acceso de los alumnos y docentes al conocimiento a través de la generación de un entorno digital que permite a estos un acceso mas rápido y abarcativo al conocimiento.

7 0
2 years ago
List 7 basic internal component found in a computer tower?
NISA [10]
7 Basic Internal Component found in a computer tower:

1) Power Supply
2) Central Processing Unit (CPU)
3) Hard Disk Drive (HDD)
4) Motherboard
5) Video card
6) Random Access Memory (RAM)
7) Sound Card

*Expansion Card, Network Card, Bluetooth Card
3 0
3 years ago
Read 2 more answers
Zenmap's topology tab displays a __________ that shows the relative size and connection type of all discovered ip hosts.
VladimirAG [237]
<span>Zenmap's topology tab displays a "Bubble Chart" that shows the relative size and connection type of all discovered IP hosts.
</span>A kind of chart which shows three dimensional data is known as Bubble chart. It also can be seen as the variation of scatter plot where bubbles replace the data points.
4 0
2 years ago
What is logic gate? ​
Firdavs [7]
A logic gate is an idealized or physical device implementing a Boolean function; that is, it performs a logical operation on one or more binary inputs and produces a single binary output.
7 0
2 years ago
Read 2 more answers
Other questions:
  • Which two technologies support the building of single-page applications?
    11·1 answer
  • What is an example of constructive criticism for an employee who frequently arrives late?
    10·2 answers
  • Because public key encryption requires the use of two different keys, it is also known as _____ encryption
    13·1 answer
  • What is the most consistent item regardless of the software used in BI?
    5·1 answer
  • PLEASE HELP
    6·1 answer
  • What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
    10·1 answer
  • The default paper size is _____. <br> a. letter <br> b. legal <br> c. executive <br> d. statement
    7·1 answer
  • When two or more tables share the same number of columns, and when their corresponding columns share the same or compatible doma
    12·1 answer
  • Will give brainliest!<br> Who created binary, and does anyone have any idea how?
    13·1 answer
  • Consider sending a stream of packets from host a to host b using ipsec. typically, a new sa will be established for each packet
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!