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

Which of the equations shown have infinitely many solutions?Select all that apply.A 3x - 1 = 3x + 1® 2x - 1 = 1 - 2x© 3x - 2 =2x-3D 3(x - 1) = 3x - 3​
how do negative exponents become positive?​
Ebony earns 2000 a month if she spends 450 a month
reduce 2.525 liters ti microliters
Discuss Kohlberg's theory of moral development, and how you think it applies to other cultures.  What do you think of the possible gender bias of Kohlberg's the
What kind of angles are they! Please help!
Which of the following atoms typically form negative ions? (a) F (b) Li (c) Ne (d) S (e) Al (f) Be
Simplify √32 + √16 + V8
describe how the southern states suppressed african american rights after the military moved out of the south following reconstruction
Graph f(x)=[tex]2^{x}[/tex]−1 and g(x)=−x+5 on the same coordinate plane. What is the solution to the equation f(x)=g(x) ? X=?