Home »
MCQs »
C# MCQs
What will be the output of the following C# code? | Questions 1
29. What will be the output of the following C# code?
using System;
namespace MyApplication {
class Program {
static void Main(string[] args) {
bool x = true;
Console.Write(Convert.ToString(x));
}
}
}
- True
- true
- False
- false
Answer: A) True
Explanation:
In the above C# code, we are using Convert.ToString() method which converts bool to string. Thus, the output will be "True".