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

write words to match the expression. 24- ( 6+3)
which city was located nearest the nile river delta
Which two numbers have a difference of 5 and a product of 3.36???
write words to match the expression. 24- ( 6+3)
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
which city was located nearest the nile river delta
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
what other areas beside egypt did the new kingdom pharoahs conquer