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

Geometry- please hurry!!
Subtraction of integers1. 8-9 = (8) + (-9) = 2.-23-(+10) - (-4) =3. (+17) - (-20) -(+12)4.-200 - (-120) -25 =5. 53 - (-17) + (-6) =​
A set of numbers is shown below: {0, 0.6, 2, 4, 6} Which of the following shows all the numbers from the set that makes the inequality 2x + 3 ≥ 7 true? {4, 6}
24a + 15 Please help
In 1936, what did Hitler’s armies do and how did Britain and France react?
Find the reference angle for the angle 37pie/6
If the binomial 2x+8 was multiplied by 5 the result would be equivalent to (1) 10x + 40 (3) 7x +13 (2) 2x +13 (4) 10x + 8
Does their always have to be a winner and a loser in a disagreement? Why or why not?
Which best describes the impact of the French and Indian War? A) Even though the British and American colonists defeated the French, it led to the taxation of
Pizza is classified as an element a compound a mixture