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

Kareem Abdul-Jabbar scored a total of 38,387 points in his basketball career. What are Kareem's total points rounded to the nearest thousand?
what are integers? the teacher told us but i was confused.
Four significant outcomes of the 1949 Communist Revolution in China were _____.
The Epic of Gilgamesh was the product of the _____ civilization.
what was one speech givin by abe lincoln
What two numbers add up to 1 but multiply to -2
5 facts which confirm that earth is round
what two number mutiply to -240 but add up to 8
A sentence that contains both dependent and independent clauses is known as a(n) a. simple sentence. b. complex sentence. c. compound sentence. d. independe
Which of the following is an example of an abiotic factor? a. A wind factor b. A duck c. A human d. A bacterium