41 .
What Will Be The Output Of The Following Code:
using System;
public class Program
    {
        public static void Main(string[] args)
        {
            char[] num = { '1', '2', '3' };
            Console.WriteLine(" char array: " + num);
        }
 
    }

A.char array: {123}
B. char array: [123]
C. char array: System.Char[]
D.char array: 123
View AnswerAns: char array: System.Char[]
42 .
What Will Be The Output Of The Following Code:
using System;
public class Program
    {
        public static void Main(string[] args)
        {
            Program obj = null;
            Console.WriteLine(Program.print());
        }
        private static String print()
        {
            return "Hi, I am a Tech-savvy!!";
        }
    }

A.Hi, I am a Tech-savvy!!
B. The program compiled successfully and nothing is printed
C. Error
D.None of the above
View AnswerAns: Hi, I am a Tech-savvy!!
43 .
What Will Be The Output Of The Following Code:
using System;
using System.Collections.Generic;
public class Program
    {
        public static void Main(string[] args)
        {
            string[] strings = { "abc", "def", "ghi" };
            var actions = new List();
            foreach (string str in strings)
              actions.Add(() => { Console.WriteLine(str); });

            foreach (var action in actions)
              action();
        }
    }

A.abc def ghi
B. ghi ghi ghi
C. abc abc abc
D.Error
View AnswerAns: abc def ghi
44 .
What Will Be The Output Of The Following Code:
using System;
using System.Collections.Generic;
public class Program
    {
        public static void Main(string[] args)
        {
            var actions = new List();
            for (int i = 0; i < 4; i++) actions.Add(() => Console.WriteLine(i));
            foreach (var action in actions)
                action();
        }
    }

A.0 1 2 3
B. 1 2 3 4
C. 4 4 4 4
D.Error
View AnswerAns: 4 4 4 4
45 .
What Will Be The Output Of The Following Code:
using System;
using System.Collections.Generic;
namespace TechBeamers
{
    delegate string del(string str);
    class sample
    {
        public static string DelegateSample(string a)
        {
            return a.Replace(',', '*');
        }
    }
    public class InterviewProgram
    {
        public static void Main(string[] args)
        {
            del str1 = new del(sample.DelegateSample);
            string str = str1("Welcome,,friends,,to,,TechBeamers");
            Console.WriteLine(str);
        }
    }
}

A.Welcome,friends,to,TechBeamers
B. Welcome**friends**to**TechBeamers
C. Welcome*friends*to*TechBeamers
D.Welcome friends to TechBeamers
View AnswerAns: Welcome**friends**to**TechBeamers