johnpb6423 johnpb6423
  • 17-07-2019
  • Computers and Technology
contestada

1. What is theoutput of the following code fragment if the input values are 1 and2?
int x;
int y;
cin>>x;
cin>>y;
cout< cout< A. 1
2
B. 1 2
C. 12
D. xy

Respuesta :

aldair47x
aldair47x aldair47x
  • 29-07-2019

Answer:

Hi,  in the last one a correct way of the code will be:

cout<<x<<y;

or

cout<<x;

cout<<y;

In the first case you get 12, the C.

In the second case you also get the C.

Explanation:

If you want to make a jump line you have to use endl

e.g.

cout<<x<<endl;

cout<<y<<endl;

And after this you get:

1

2

In the other ways, you get the previously result in the output.

I hope it's help you.

Answer Link

Otras preguntas

I need help understanding how to do the Pythagorean Therom while doing problems like this
Consider the following system: x=2y+5 4x-8y=20 When solving this system by the substitution method, 20=20 is obtained. What is the solution set? A. The solution
What is the IUPAC name of the following compound?
The Glorious revolution was a? A.) coup in England during which king William was overthrown. B.) coup in England during king janes || was overthrown. C.) rebel
Find the missing lengths: LH=45 and KH=30, find HI.
Jamie paid $90.95, including 7% tax, for a pair of Nike running shoes. How much did the pair of shoes itself cost?
flordia was acquired from what state​
State one factor responsible for the variety of traditional practices in the Caribbean. (in Social studies)​
1. Previous balance = $104.15Annual rate = 14%Finance charge = $ ___New purchases = $31.23Payments/credits = $42.50New balance = $___2. Previous balance = $224.
what equation represents the relationship between r and s shown in the table?