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

The impact of a strike is limited to the ability of the union to
In which country did the Chernobyl nuclear disaster take place? Russia Ukraine Belarus Georgia NextReset
The conquistadores were a.)conquering Spanish soldiers b.)Aztec warriors c.)Inca warriors d.)Navy Seals (please help)
MgO(s) + H2O(l) → Mg(OH)2(aq)
Choose either Maus or All Rivers Run to the Sea. How do genre and point of view contribute to the power of Holocaust literature? Use evidence from your chosen t
Explain the difference between the following two expressions. (-1)^2/4 and (-1)^1/2
Which term refers to South Asia's unique geographical position in Asia? atoll alluvial plain subcontinent delta
A regression equation was estimated as = –100 + 0.5x. if x = 20,the predicted value of y is _____.
One of the long-term political consequences of northern victory was a
Amoebas are unicellular organisms while human beings are multicellular both are classified as eukaryotes how will you justify this reasoning?