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

how many animals went extinct in the u.s. in 2015?
What is the area of each face of cube A? If cube A is 1/2 inch on each face
The amount in a savings account increased from 200 to 216. What was the percent of increase?
how many tablespoons in a cup
How did the achievement of women's suffrage change society's opinion of women? (not state test or any test)
It seems that the vice president has broken some laws. What can be done about the situation?
how long does it take to become a physical therapist
what is an interrogative sentence
what time is it on the east coast
which answer best explains how certain patterns of histone acetylation or dna methylation could influence whether a cell became a muscle cell or a brain cell?