wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming C#

Total questions: 20

Worksheet time: 17mins

Name
Class
Date
1.
C# (C-Sharp) was developed by
a)
Sun Microsystems
b)
Mircosoft
c)
IBM
d)
Apple
2.
What is CLR ?
a)
Conventional Language Runtime
b)
Common Language Runtime
c)
Colloquial Language Runtime
d)
All
3.
Which of the following constitutes the .NET Framework?
a)
ASP.NET Applications
b)
CLR
c)
Framework Class Library
d)
None
4.
How many language supported 4,5 framework
a)
50
b)
40
c)
63
d)
65
5.
Visual Studio .NET provides which feature
a)
debugging,
b)
application deployment.
c)
syntax checking
d)
All
6.
C# (C-Sharp) belong to which framework ?
a)
Java
b)
.NET
c)
Oracle
d)
None
7.
A variable which is declared inside a method is called a________variable?
a)
local
b)
global
c)
static
d)
All
8.
Which language is not a true object-oriented programming language?
a)
C#
b)
Java
c)
ASP
d)
VB
9.
A C# program may consist of the following parts.
a)
Namespace declaration
b)
Class methods
c)
A main method
d)
All
10.
what it is CTS
a)
common type system
b)
common type specification
c)
common type serial
d)
None
11.
Which of the following statements is correct about String in C#?
a)
A String is created on the stack.
b)
A String is created on the heap.
c)
A String is a primitive type.
d)
none
12.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL"; String s2; s2 = s1.Substring(12, 3); Console.WriteLine(s2);
a)
ARE
b)
CRE
c)
CR
d)
CREATED
13.
Which one of the following statements is correct?
a)
Array elements can be of integer type only.
b)
The rank of an Array is the total number of elements it can contain.
c)
The length of an Array is the number of dimensions in the Array.
d)
The default value of numeric array elements is zero.
14.
The string built using the String class are immutable (unchangeable),
whereas, the ones built- using the StringBuilder class are mutable.
a)
True
b)
False
15.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Nagpur"; String s2; s2 = s1.Insert(6, "Mumbai"); Console.WriteLine(s2);
a)
Nagpur
b)
Mumbai
c)
NagpurMumbai
d)
None
16.
If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?
a)
s1 is s2
b)
s1 = s2
c)
s1.Equals(s2)
d)
strcmp(s1, s2)
17.
What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { string str= "Hello World!"; Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() ); } } }
a)
0
b)
1
c)
System.Int32
d)
hello world
18.
What Will Be The Output Of The Following Code Snippet?
using System; class program { static void Main(string[] args) { int num = 2; fun1 (ref num); Console.WriteLine(num); Console.ReadLine(); } static void fun1(ref int num) { num = num * num * num; } } 
a)
2
b)
4
c)
8
d)
10
19.
Which of the following statements is correct about Managed Code?
A.Managed code is the code that is compiled by the JIT compilers.
B.Managed code is the code where resources are Garbage Collected.
C.Managed code is the code that runs on top of Windows.
D.Managed code is the code that is written to target the services of the CLR.
a)
A
b)
B
c)
C
d)
D
20.
Code that targets the Common Language Runtime is known as
A.Unmanaged
B.Distributed
C.Legacy
D.Managed Code
a)
A
b)
B
c)
C
d)
D