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

The ratio of the number of left-handed batters to the number of right handed batters is 5:8. There are 45 left-handed batters. find the ratio of the number of l
Which two key principles of government are included in the Declaration of Independence?
Compare Dobereiner’s triads to the modern periodic table. What aspects of his idea agreed with the modern table and what aspects did not
The weakness of the Articles of Confederation led to the Critical Period. Which of the following was part of the Critical Period? a. States fought amongst each
Between which pair of numbers is the exact product of 379 and 8
According to Herbert hoover, what would best help those devastated by the great depression
Which element of Greek tragedy refers to the tragic flaw within the protagonist that helps bring about his or her downfall?
What is one geographic characteristic and explain how it made early life Greece unique.
What made americans cautious about playing too much power in the hands of a single ruler?
True or false? Pluto is less than 2/3 the size of Earth's moon?