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

Consider the following statement. Fourteen more than 12 times the number equals 37 less than 11 times a number. a. Write an equation to represent the statement.
what is the main functions of lipids?
how are plains formed
why do the two elements silver and iron have different properties?
how do i persuade students to enter the school talent show? i have to write it as an article in the school magazine.
Using the laws of indices, simplify the following:- √h × √h³ =
What phylum has animals with soft bodies, and most of them have shell-like coverings?
A basketball rolls of a 0.70 m high desk and strikes the floor 0.25 m away from the base of the desk? How fast was the ball rolling?
briefly describe the five stages of the cell cycle
6 metres cost 3.00. what is the cost of 1 metre?