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 is the water supply for New York being protected?
explain why atoms move at different speeds depending on whether they are in liquids or solids.
A square piece of fabric has an area of 16x^2+40x+25 square inches. The length of each side of the fabric is cx+d, where c and d are whole numbers. Find an expr
How is infinite .99999999999 equal 1? (explain)
The mestizo resulted from?
What are three factors that contribute to a source not being credible
The radius of a circular sign is decreased by 4 inches. If r represents the radius of the original sign, which equation represents the area, in square inches, o
Why was the Battle of Saratoga a turning point in the American Revolution? A. It was the last major battle of the war. B. It convinced the Americans that they h
three times the sum of a number and 3 is -18 (equation )
The ratio of ages (in years) of three children is 2:4:5. The sum of their ages is 33. What is the ages of each child ?