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 have your thoughts changed about Evolution overtime
Find all the common factors of 8 and 12. A) 2, 4 B) 1, 2, 4 C) 1, 2, 4, 8
The marketing department of the Fitrite shoe company surveyed people who had never bought Fitrite shoes. The top 4 reasons for not buying Fitrite shoes are show
A composite figure is comprised of a semicircle, trapezoid, and 2 rectangles. How can you decompose the composite figure to determine its area? as a circle, thr
Efforts to create realistic images started with the ancient _______, who were interested in math and science
Explain one reason George Washington warned against divided political parties?
f(x) = 3x - 2x - 5 Factoring quadratics
Where do the roles of the president come from?
Line g is dilated by a scale factor of 3 from the origin to create line g'. Where are points E’ and F’ located after dilation, and how are lines g and g' relate
PLEASE HELP PLEASE help