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
elena-s [515]
3 years ago
15

Use the variables k, d, and s so that they can read three different values from standard input--an integer, a double, and a stri

ng respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.
Computers and Technology
1 answer:
Nat2105 [25]3 years ago
7 0

Answer:

The c++ program to implement the given scenario is shown below.

#include <iostream>

using namespace std;

int main() {

   // variables declared as mentioned

   int k;

   double d;

   string s;

   cout << " Enter an integer value, a double value, a string value in the mentioned order " << endl;

   cin >> k >> d >> s;

   // variables printed in reverse order

   cout << " Reverse order " << endl;

   cout << s << " " << d << " " << k << endl;

   // variables printed in original order

   cout << " Original order " << endl;

   cout << k << " " << d << " " << s << endl;

   return 0;

}

OUTPUT

Enter an integer value, a double value, a string value in the mentioned order  

12 45.67 brainly

Reverse order  

brainly 45.67 12

Original order  

12 45.67 brainly

Explanation:

1. All the variables are declared as mentioned in the question.

int k;

   double d;

   string s;

2. The user is prompted to enter values for integer, double and string variables respectively. The input is accepted in the order mentioned above.

cin >> k >> d >> s;

3. The input is accepted in a single line since this is mentioned in the scenario that variables should be printed in the order in which they are read.

4. These variables are displayed to the standard output in reverse order – string, double, integer. The variables are displayed with exactly one space in between them.

cout << s << " " << d << " " << k << endl;

5. Then, variables are displayed in the original order – integer, double, string. The variables are displayed with exactly one space in between them.

cout << k << " " << d << " " << s << endl;

You might be interested in
Which of these is not an application software?
fredd [130]
A; control and measurment
6 0
3 years ago
Read 2 more answers
Do you think cell phones are addictive? Why or why not? (Give three reasons and explain.) pls help i will mark brainliest too :D
andreev551 [17]

<em>Answer:</em>

<em>I do think cell phones are addictive. Most people use their phones for social interactions and are constantly checking to see if anyone messaged them or liked their post(like me). My sister uses her phone to facetime her friends and is always eager and waiting for them to answer and she acts like there is nothing else in the world to do which shows true addiction. One last reason cell phones are addictive because without one you think you are missing out on something but your really just missing out on life outside of your phone</em>

<em>Explanation:</em>

5 0
3 years ago
What are some features of that that you find difficult to use, hard to locate,etc
zysi [14]
What is it? Send a picture maybe.
4 0
3 years ago
What two different types of encryption can be used by ipsec during data transfer?​?
daser333 [38]
The two types of encryption are:

Authentication Header (AH)<span> 
Encapsulating Security Payload (ESP)</span>
3 0
3 years ago
There are a number of national parks that we_______up to now.
Oduvanchick [21]

Answer:https://en.wikipedia.org/wiki/New_York_City

New York City (NYC), often called simply New York, is the most populous city in the United States.With an estimated 2019 population of 8,336,817 distributed over about 302.6 square miles (784 km 2), New York City is also the most densely populated major city in the United States. Located at the southern tip of the State of New York, the city is the center of the New York metropolitan area, the ..

Explanation:

6 0
3 years ago
Other questions:
  • the task is to ask the user for three numbers and find the average which pseudocode gives you the comment outline for task​
    10·1 answer
  • In three to five sentences, describe how good e-mail work habits increase workplace efficiency and productivity.
    12·1 answer
  • Write the definition of a method printarray, which has one parameter , an array of int s. the method does not return a value . t
    10·1 answer
  • You are the network administrator for a small organization of 100 users. Users till now were freely browsing the Internet. You w
    8·1 answer
  • give your opinion on if you would trust your accounts with an online bank. Explain why or why not. MANY people do not. MANY peop
    14·2 answers
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • Computers can be positioned on a network in different ways relative to each other. true false
    11·1 answer
  • In a computer instant messaging​ survey, respondents were asked to choose the most fun way to​ flirt, and it found that ​P(D)equ
    12·1 answer
  • PLZ HELP What will be the output? class num: def init (self.a): self. number = a mul* __(self. b) return self. number + b. numbe
    7·1 answer
  • How r u<br> ;)<br> happy what day is it
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!