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

Which of the following statements is true of entrepreneurs?
-2y - 5x >6 solve for y
A box of mass 22g is attached to a horizontal spring with spring constant 145N/m. The spring is then extended by 6 cm, and the box is subsequently released. Cal
Task 1 Predicting Trait Inheritance In this task, you will design a species, determine its genetic variation, and predict the genetic inheritance pattern. Es
the fraction of carbon dioxide molecules in the atmosphere is about 0.000419. convert this number to scientific notation
which is the best option when an active shooter is in your vicinity
At the end of the novel, Robert Walton gives up his expedition because: Victor has convinced him that ambition is dangerous. his crew is threatening to mutiny i
What is the coefficient of the second term of the trinomial? (6p+2)2=36p2+Bp+4
Find the value of x and y in the figure. Help pleaseeeee ​
if meeting all the goals is not possible witha available resorces how are goals selected for funding