Ask Question

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);

+1
Answers (1)
  1. 5 May, 06:37
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers