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
Why is it a good idea to leave an interview being courteous and polite?
JulsSmile [24]
It Will Show How Humble You Are. It will also show your ability to control emotions.
8 0
3 years ago
House real estate summary Sites like Zillow get input about house prices from a database and provide nice summaries for readers.
Ksivusya [100]

Answer:

current_price = int(input("Enter the current price: "))

last_months_price = int(input("Enter the last month's price: "))

print("This house is $" + str(current_price))

print("The change is $" + str(current_price - last_months_price) + " since last month")

print("The estimated monthly mortgage is ${:.2f}".format((current_price * 0.051) / 12))

Explanation:

Ask the user to enter the current price and last month's price

Print the current price

Print the change in the price, subtract the last month's price from the current price

Print the estimated monthly mortgage, use the given formula to calculate, in required format

6 0
4 years ago
As u type where does excel display the entry
grigory [225]

Answer:

The Active cell inside Excel Worksheet is used to identify the cell which is currently active. The thick border gridlines around the cell indicates that it is the Active cell inside Excel Worksheet. The Active cell is where the focus is on and where the data will be entered when a key is typed on keyboard.

5 0
3 years ago
" Which technique for representing numeric data uses the mantissa to hold the significant digits of a value?"
UkoKoshka [18]

Answer:

signed magnitude

Explanation:

A numeric value that is approximate consists of a mantissa and an exponent. The mantissa is a signed numeric value, so also is the exponent a signed integer that specifies the magnitude of the mantissa.

4 0
4 years ago
January 19/May 16 2022
fenix001 [56]

Answer:

This should get you started. Many things could be improved. You could keep adding layers to this program if you wanted to, so I wrote it with that in mind.

The new salary depends on the employee's department and current salary. I created a class that represents each employee. The function looks at the employee's current salary, and looks up what the employee's department raise will be (using the dictionary/hash table) before performing the calculation.

3 0
2 years ago
Other questions:
  • Which are examples of embedded systems? Choose two answers.
    15·1 answer
  • instructor is describing a component that is always located on the CPU and accelerates the processing of instructions. Which com
    12·1 answer
  • Advantages of e commerce
    14·1 answer
  • What is the value of i printed? j = i = 1 i += j + j * 5 print("What is i?", i)
    11·1 answer
  • Can someone please help me
    11·1 answer
  • A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
    15·2 answers
  • &gt;What is the output of the following code:
    5·1 answer
  • Cost, time, knowledge are examples of
    9·1 answer
  • Any task done by software can also be done using computer hardware, and any operation performed directly by hardware can be done
    8·1 answer
  • Write a Java program that prompts for integers and displays them in binary. Sample output: Do you want to start(Y/N): y Enter an
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!