What will be the output of the following C# code?

static void Main(string[] args)
 {
     char c = 'g';
     string s = c.ToString();
     string s1 = "I am a human being" + c;
     Console.WriteLine(s1);
     Console.ReadLine();
 }

a) I am a human bein c
b) I am a human being
c) I am a human being c
d) I am a human bein

1 thought on “What will be the output of the following C# code?”

  1. b
    Explanation: ‘g’is stored in character variable ‘c’ which later on is converted to string using method Convert.Tostring() and hence appended at last of the string in s1.
    Output: I am a human being.

Leave a Comment