ExamVeda
Login
Home
1
Choose effective differences between 'Boxing' and 'Unboxing'.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
Which data type should be more preferred for storing a simple number like 35 to improve execution speed of a program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
3
What will be the output of the following C# code?
public static void Main(string[] args)
{
    int i = 123;
    object o = i;
    i = 456;
    System. Console. WriteLine("The value-type value = {0}", i);
    System. Console. WriteLine("The object-type value = {0}", o);
    Console. ReadLine();
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
4
What will be the output of the following C# code?
class Program
{
    static void Main(string[] args)
    {
        int  i ;
        for (i = 0; i < 5; i++)
        {
            Console.WriteLine(i);
        }
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
5
Number of digits upto which precision value of float data type is valid?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
6
Minimum and Maximum range of values supported by 'float' data type are?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
7
What will be Correct Set of C# Code for given data 'a' and 'b' to print output for 'c' as 74?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
8
What will be the output of the following C# code?
class Program
{
    public static void Main(string[] args)
    {
        int i = 100;
        for (a = 0; a < 5; a++)
        {
            int i = 200;
            Console. WriteLine(a * i);
        }
        Console. ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
9
Given is the code of days(example:"MTWTFSS") which I need to split and hence create a list of days of week in strings( example:"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"). A set of code is given for this purpose but there is the error occurring in that set of code related to the conversion of char to strings. Hence, Select a C# code to solve the given error.
static void Main(string[] args)
{
    var days = "MTWTFSS";
    var daysArray = days.ToCharArray().Cast<string>().ToArray();
    for (var i = 0; i < daysArray.Length; i++)
    {
        switch (daysArray[i])
        {
        case "M":
            daysArray[i] = "Monday";
            break;
        case "T":
            daysArray[i] = "Tuesday";
            break;
        case "W":
            daysArray[i] = "Wednesday";
            break;
        case "R":
            daysArray[i] = "Thursday";
            break;
        case "F":
            daysArray[i] = "Friday";
            break;
        case "S":
            daysArray[i] = "Saturday";
            break;
        case "U":
            daysArray[i] = "Sunday";
            break;
        }
    }
    daysArray[daysArray.Length - 1] = "and " + daysArray[daysArray.Length - 1];
    Console.WriteLine(string.Join(", ", daysArray));
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
10
Does the output remain same or different for both cases?
i.
char l ='k';
float b = 19.0f;
int c;
c = (l / convert.ToInt32(b));
Console.Writeline(c);

ii.
char l ='k';
float b = 19.0f;
int c;
c = Convert.ToInt32(l / b);
console.writeline(c);
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board