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
Suppose you are given a relation emp(empid, dept, salary) and wish to maintain a materialized view deptsalary(dept, totalsalary)
NeX [460]

Answer:

WITH deptsalary AS (

SELECT dept,  SUM(salary)

FROM emp

GROUP BY dept)

SELCT *

FROM deptsalary

Explanation:

deptsalary is temporary table.

dept and its respective sum of salary is to be displayed

7 0
3 years ago
Which logical operators perform short-circuit evaluation?.
Sergio039 [100]

Answer:

Short-circuit evaluation is performed with the not operator.

8 0
3 years ago
How far is florida from oklahoma?
leonid [27]
Florida is 1,344.8 miles from oklahoma
7 0
3 years ago
Read 2 more answers
Which two functions can be used with the math module?
GrogVix [38]

Answer: The math module presents two angle conversion functions: degrees() and radians() , to convert the angle from degrees to radians and vice versa. For example, the following statements convert the angle of 30 degrees to radians and back (Note: π radians is equivalent to 180 degrees).

Explanation: Hopefully this helps you. It is a full answer.

5 0
3 years ago
Class secretType { public: static int count; static int z; secretType(); secretType(int a); void print(); static void incrementY
ANEK [815]

Answer:

a. secretType mySecret(9)

Explanation:

6 0
3 years ago
Other questions:
  • All of these are required categories on a safety data sheet except
    14·2 answers
  • What port does rdp use by default and from what range of numbers should you select a private port number?
    15·1 answer
  • Which of the following is not a valid FICO Credit score?
    12·2 answers
  • Lisa wants to send an email with some confidential Information. Which of these options would work best for her?
    6·1 answer
  • Which type of memory helps in reading as well as writing data?
    13·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • What are the disadvantages of using pointers?
    6·1 answer
  • Which Backstage view feature helps you to specifically remove customized information from a document? Protect Document Feedback
    14·1 answer
  • The basic component of the drive train system is the ____________.
    12·2 answers
  • (1) Experiment Purpose
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!