What Will Be The Output For Following Input From The Console As #554
What will be the output for following input from the console as a character?</p> <pre><code class="language-csharp" line="1"> static void Main(string[] args) { Console.WriteLine("what is your name?"); char s; s = Convert.ToChar(Console.ReadLine()); Console.WriteLine("how are you: "+s); Console.Read(); } </code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs108 CSharp.
It can also be found in
gs gs108 Console I/O Operations and Stream Classes - Reading Console Input Operations - Quiz No.1.
What will be the output for following input from the console as a character?
static void Main(string[] args) { Console.WriteLine("what is your name?"); char s; s = Convert.ToChar(Console.ReadLine()); Console.WriteLine("how are you: "+s); Console.Read(); }
Compile time error
Code run successfully prints nothing on console
Code runs successfully prints input on console
Run time error