Online C# Programming Test - C# Programming Test 8
Instruction:
- This is a FREE online test. Beware of scammers who ask for money to attend this test.
- Total number of questions: 20.
- Time allotted: 30 minutes.
- Each question carries 1 mark; there are no negative marks.
- DO NOT refresh the page.
- All the best!
Marks : 2/20
Total number of questions
20
Number of answered questions
0
Number of unanswered questions
20
Test Review : View answers and explanation for this test.
1.
Which of the following statements correctly define .NET Framework?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
2.
Which of the following statements are TRUE about the .NET CLR?
- It provides a language-neutral development & execution environment.
- It ensures that an application would not be able to access memory that it is not authorized to access.
- It provides services to run "managed" applications.
- The resources are garbage collected.
- It provides services to run "unmanaged" applications.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
3.
Which of the following statements is correct about the C#.NET code snippet given below?
switch (id)
{
case 6:
grp = "Grp B";
break;
case 13:
grp = "Grp D";
break;
case 1:
grp = "Grp A";
break;
case ls > 20:
grp = "Grp E";
break ;
case Else:
grp = "Grp F";
break;
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Control Instructions
4.
Which of the following is the correct output for the C#.NET program given below?
int i = 20 ;
for( ; ; )
{
Console.Write(i + " ");
if (i >= -10)
i -= 4;
else
break;
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Control Instructions
5.
Which of the following statements are correct?
- A switch statement can act on numerical as well as Boolean types.
- A switch statement can act on characters, strings and enumerations types.
- We cannot declare variables within a case statement if it is not enclosed by { }.
- The foreach statement is used to iterate through the collection to get the desired information and should be used to change the contents of the collection to avoid unpredictable side effects.
- All of the expressions of the for statement are not optional.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Control Instructions
6.
Which of the following are NOT Relational operators in C#.NET?
- >=
- !=
- Not
- <=
- <>=
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Operators
7.
Which of the following statements are correct about functions used
in C#.NET?
- Function definitions cannot be nested.
- Functions can be called recursively.
- If we do not return a value from a function then a value -1 gets returned.
- To return the control from middle of a function exit function should be used.
- Function calls can be nested.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Functions and Subroutines
8.
Which of the following statements is correct about constructors?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
9.
Which of the following statements is correct about the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int func()
{
return 1;
}
public Single func()
{
return 2.4f ;
}
}
class Program
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
int i;
i = s1.func();
Single j;
j = s1.func();
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
10.
Which statement will you add in the function fun() of class B, if it is to produce the output "Welcome to IndiaBIX.com!"?
namespace IndiabixConsoleApplication
{
class A
{
public void fun()
{
Console.Write("Welcome");
}
}
class B: A
{
public void fun()
{
// [*** Add statement here ***]
Console.WriteLine(" to IndiaBIX.com!");
}
}
class MyProgram
{
static void Main (string[ ] args)
{
B b = new B();
b.fun();
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
11.
Which of the following statements is correct about the array declaration given below?
int[][][] intMyArr = new int[2][][];
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Arrays
12.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(s1.Length);
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
13.
Which of the following statements is correct about the C#.NET code snippet given below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample ss = new Sample();
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Structures
14.
Which of the following statements is true about an enum used in C#.NET?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Enumerations
15.
Which of the following will be the correct output for the C#.NET code snippet given below?
enum color : int
{
red = -3,
green,
blue
}
Console.Write( (int) color.red + ", ");
Console.Write( (int) color.green + ", ");
Console.Write( (int) color.blue );
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Enumerations
16.
Which of the following statements are correct about the Stack collection?
- It can be used for evaluation of expressions.
- All elements in the Stack collection can be accessed using an enumerator.
- It is used to maintain a FIFO list.
- All elements stored in a Stack collection must be of similar type.
- Top-most element of the Stack collection can be accessed using the Peek() method.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
17.
Which of the following statements are correct about a HashTable collection?
- It is a keyed collection.
- It is a ordered collection.
- It is an indexed collection.
- It implements a IDictionaryEnumerator interface in its inner class.
- The key - value pairs present in a HashTable can be accessed using the Keys and Values properties of the inner class that implements the IDictionaryEnumerator interface.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
18.
Which of the following statements is correct about properties used in C#.NET?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Properties
19.
Which of the following statements is correct about the C#.NET program given below?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index = 6;
int val = 44;
int[] a = new int[5];
try
{
a[index] = val ;
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program");
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Exception Handling
20.
Which of the following keyword is used to overload user-defined types by defining static member functions?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Polymorphism
*** END OF THE TEST ***
Time Left: 00:29:56
Post your test result / feedback here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers