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
You work in an office that uses Linux and Windows servers. The network uses the IP protocol. You are sitting at a Windows workst
vichka [17]

Answer:

Ping

Explanation:

If working in an environment that uses Linux and Windows servers and the network using IP protocol, if an application you are using is unable to to connect to a windows server named FileSrv2, you will need to test network connectivity between your workstation and the server by using either the "ping" or "traceroute" command.

3 0
3 years ago
This allows you to access structure members.
MrMuchimi

Answer:

The correct option for the given question is option(B) i.e dot operator

Explanation:

Structure are collection of different datatypes member element .

Let us consider the example of structure

Struct test

{

int age ;

char name[45];

};

Here test is an "structure" which member is age of "integer" type and name of "String" type.if we have to access the member of structure,firstly we create structure variable name then after that we use dot operator which is also known as member access operator that access the members of structure.

struct test op;//  structure variable name

op.age=12; // access the member age

For example

Following is the code in c language :

#include <stdio.h> // header file

struct test // structure declaration

{

int age ;

char name[45];

};

int main() // main function

{

struct test op;//  structure variable name

op.age=12; // access the member age

printf("%d",op.age);

return 0;

}

Output:12

so correct answer is "dot operator"

3 0
3 years ago
What were the first microblogs known as
Greeley [361]
The first micro blogs was once known a tumblogs
6 0
3 years ago
Read 2 more answers
Write a HTML program as shown in the output.​
Vitek1552 [10]

Explanation:

<html>

<title>first term 9/<title>

<head>SUNGHAVA SHIKSHA NIKETANA</head>

<body>

<h1>maths formula</h1>

<h6>a2-b2=(a+b)(A-B)</h6>

<h1>list of exams<\h1>

<h6>1.computer,2.english,3science</h6>

</body>

</html>

3 0
3 years ago
How do i answer a question on brainly????
ddd [48]

Answer:

there is an answer button below the questions

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • When computers are connected and operate through one main computer, it is called a _________ network
    14·2 answers
  • Subnetting is accomplished by borrowing bits from the _____ portion of an ip address and reassigning those bits for use as netwo
    13·1 answer
  • While it might be considered "old-school," which action should you take if you are unsure how a page will print, even after look
    7·1 answer
  • A microphone plugs into what type of connector
    5·2 answers
  • ________ development is the term used to describe an information system development methodology that emphasizes flexibility and
    11·1 answer
  • When adding shapes to a presentation, the outline can be one color, and the fill must be the exact same color.
    12·2 answers
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    15·1 answer
  • Who developed the first personal computer called the altair
    15·1 answer
  • In which cipher method are values rearranged within a block to create the ciphertext?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!