cklangford98 cklangford98
  • 02-03-2018
  • Computers and Technology
contestada

Given the code below, what would output to the Console Window?

Think carefully on this one...it is tricky!
C#
1
string a = ”10”;
2
string b = “20”;
3
Console.WriteLine(a+b+5);

Respuesta :

spikespaz
spikespaz spikespaz
  • 03-03-2018
I don't know C# but based on experiences in other OOP languages and languages in general, you get a type error, whatever format that may be for C#. You cannot concatenate "10" and "20" as strings and then attempt to add an integer 5 unless the language has inferred type coercion.
Answer Link

Otras preguntas

how do i change a trapezoid into a rectangle
Two famous Elizabeth Blackadder paintings ?
If a = b + 2, then (b - a)⁴ = ?
Who was the African-American who called the war with Mexico disgraceful and cruel? Why?
Two famous Elizabeth Blackadder paintings ?
In a right-angled triangle, the side opposite the right angle is unknown, how do you find out the unknown length? (Hypotenuse I think)
Which of the following changes will decrease the rate of collisions between gaseous molecules oftype A and B in a closed container? A. decrease the volume of t
Which of the following is a requirement for membership in either the Democratic or Republican Party? A. pass a test on the party philosophy B. pay a cert
Suppose x + y = 6 and xy = 4. Find the value of x² y + xy² without solving the equations.
Give all solutions if the nonlinear system of equations, including those with no real complex components. y=x^2+6x 4x-y=-24