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
diamong [38]
3 years ago
6

In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >

> two; executes, ____.
Computers and Technology
1 answer:
SSSSS [86.1K]3 years ago
6 0

Answer:

variable one stores 10.5 and two stores 30.6

Explanation:

In c++ language, the cout keyword is used to write to the standard output. The input from the user is taken by using the cin keyword.

For the input from the user, a variable need is declared first.

datatype variable_name;

The input can be taken one at a time as shown.

cin >> variable_name;

The input for more than one variable can be taken in a single line as given by the syntax below.

1. First, two variables are declared.

datatype variable_name1, variable_name2;

2. Both input is taken simultaneously as shown.

cin >> variable_name1, variable_name2;

For the given scenario, two double variables are declared as below.

double one, two;

The question mentions input values for the two double variables as 10.5 and 30.6.

3. The given scenario takes both the values as input at the same time, in a single line as shown below.

cin >> one >> two;

4. After this statement, both the values entered by the user are accepted.

The values should be separated by space.

First value is stored in the variable one.

Second value is stored in the variable two.

5. The user enters the values as follows.

10.5 30.6

6. The value 10.5 is stored in variable one.

7. The value 30.6 is stored in variable two.

The c++ program to implement the above is given below.

#include <iostream>

using namespace std;

int main() {

   double one, two;      

   cout << " Enter two decimal values " << endl;

   cin >> one >> two;

   cout << " The input values are " << endl;

   cout << " one : " << one << " \t " << " two : " << two << endl;

   return 0;

}

OUTPUT

Enter two decimal values  

10.5 30.6

The input values are  

one : 10    two : 530.6

You might be interested in
"This part of the computer fetches instructions, carries out the operations commanded by the instructions, and produces some out
Inessa05 [86]

Answer:

CPU

Explanation:

CPU stands for Central Processing Unit, also called: Central Processor or Main Processor.

The CPU is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logic, controlling, and input/output operations specified by the instructions.

4 0
3 years ago
Torque is defined as _____.
BlackZzzverrR [31]
<span>something that produces or tends to produce torsion or rotation; the moment of a force or system of forces tending to cause rotation.

</span>
5 0
3 years ago
Which is the last step in conducting a URL search?
m_a_m_a [10]
It all depends what you are looking for...
3 0
3 years ago
Read 2 more answers
Anyone else having problems with edg?
Kamila [148]
No what’s your problem on edge
4 0
2 years ago
personalization allows customers to modify the standard offering, such as selecting a different home page to be displayed each t
shusha [124]
True, personalization is definitely part of this.
6 0
2 years ago
Other questions:
  • Which of the following can you NOT apply for at any FLHSMV office? A. Certificate of title B. License plates C. Vehicle registra
    15·2 answers
  • Sean is white hat hacker, who is demonstrating a network level session hijack attacks and as part of it, he has injected malicio
    6·1 answer
  • Ned and mary ann are saving their files to a cd
    15·1 answer
  • WILL GIVE BRAINLIEST! I'm doing a project at school. Does anyone have any good explanations for Digital Art? I need it to be at
    13·2 answers
  • A computer that delivers requested webpages to your computer or mobile device is a(n) _________.
    9·1 answer
  • When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when
    12·1 answer
  • (Please answer! Correct answer gets brainliest!)
    5·2 answers
  • Find the reciprocal of 7/2 × 3/5<br>​
    6·1 answer
  • p3_unzip :: [(a,b)] -&gt; ([a], [b]) Write a function that takes a list of two-tuples and returns a tuple of two lists -- the fi
    9·1 answer
  • Which of the following will print I'VE GOT THIS on the screen? (5 points)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!