ExamVeda
Login
Home
81
What will be the output of the following C# code?
string s1 = " I AM BEST ";
string s2;
s2 = s1.substring (5, 4);
Console.WriteLine (s2);
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
82
What is the need for 'Conversion of data type' in C#?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
83
Scope of variable is related to definition of variable as:
i. Region of code within which variable value is valid and hence can be accessed.
ii. No, relation with region where variable is declared its value is valid in entire scope.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
84
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++)
        {
            int j = 0;
            j += i; 
            Console. WriteLine(j);
        }
        Console. WriteLine(i);
        Console. ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
85
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();
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
86
DIFFERENCE BETWEEN KEYWORDS 'VAR' AND 'DYNAMIC'?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
87
Which of the conversions are valid for the following C# code?
static void Main(string[] args)
{
    int a = 22;
    long b = 44;
    double c = 1.406;
    b = a;
    c = a;
    a = b;
    b = c;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
88
Select differences between reference type and value type:
i. Memory allocated to 'Value type' is from heap and reference type is from 'System. ValueType'
ii. Memory allocated to 'Value type' is from 'System. ValueType' and reference type is from 'Heap'
iii. Structures, enumerated types derived from 'System. ValueType' are created on stack, hence known as ValueType and all 'classes' are reference type because values are stored on heap
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
89
What will be the output of the following C# code?
static void Main(string[] args)
{
    const int a = 5;
    const int b = 6;
    for (int i = 1; i <= 5; i++)
    {
        a = a * i;
        b = b * i;
    }
    Console.WriteLine(a);
    Console.WriteLine(b);
    Console.ReadLine();
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
90
A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board