ExamVeda
Login
Home
11
What will be the output of the following C# code?
static void Main(string[] args)
{
    int [] a = {1, 2, 3, 4, 5};
    fun(a);
    Console.ReadLine();
}
static void fun(params int[] b )
{
    int[] k = { 3, 4, 7, 8,'\0' };
    for (int i = 0; i < b.Length; i++)
    {
        b[i] = b[i] + k[i] ;
        Console.WriteLine( b[i] + " ");
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
12
Which of the following string() method are used to compare two strings with each other?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
13
Which statement is correct about following c#.NET code?
int[] a= {11, 3, 5, 9, 6};
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following C# code?
 static void Main(string[] args)
 {
     int[] a = { 2, 21, 34, 46, 85, 88, 90};
     fun(a);
     Console.WriteLine(a + " ");
     Console.ReadLine();
 }
 static void fun(params int [] b )
 {
     int [] c = { 1, 2, 3, 4, 5, 6, 7};
     int i ;
     for (i = 0 ;i < b.Length ;i++)
     if (b[i] % 2 == 0)
     {
         c[i] = b[i];
     }
     Console.WriteLine("even numbers are:");
     for (i = 0 ;i <= b.Length ;i++)
     {
         Console.WriteLine(c[i]);
     }
 }
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
15
How to print \ on the screen?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 5;
    int b = 0, c = 0;
    method (a,  ref b, ref c);
    Console.WriteLine(b + "  " + c);
    Console.ReadLine();
}
static int method(int x, int p, ref int k)
{
    p = x + x * x;
    k = x * x + p;
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
Which statement is/are correct?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
18
Which of these methods of class String is used to compare two String objects for their equality?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
Which of these is used to access members of class before the object of that class is created?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
20
What is the value returned by function compareTo() if the invoking string is less than the string compared?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board