C# MCQ Assignment
C# MCQ Assignment
Question 1:
Which of the following is the correct syntax to declare a variable in C#?
int 4value;int value;int value=4;int value=
Correct Answer: 2, 3
Question 2:
Which of the following is the entry point of a C# program?
Main()Start()Program()Begin()
Correct Answer: 1
Question 3:
Which keyword is used to define an interface in C#?
interfaceclassstructenum
Correct Answer: 1
Question 4:
Which of the following is NOT a value type in C#?
intfloatdoublestring
Correct Answer: 4
Question 5:
Which of the following access modifiers allows a class member to be accessed from within the same assembly, but not from another assembly?
publicprivateprotectedinternal
Correct Answer: 4
Question 6:
What is the size of an int data type in C#?
- 2 bytes
- 4 bytes
- 8 bytes
- 16 bytes
Correct Answer: 2
Question 7:
Which of the following statements is used to handle exceptions in C#?
try-catchcatch-trytry-errorhandle-exception
Correct Answer: 1
Question 8:
What will be the output of the following code snippet?
csharpCopy codeint a = 10;
int b = 20;
int c = a + b;
Console.WriteLine(c);
- 10
- 20
- 30
- Compilation Error
Correct Answer: 3
Question 9:
Which of the following is used to read a line of text from the console in C#?
Console.ReadLine()Console.Read()Console.ReadText()Console.ReadKey()
Correct Answer: 1
Question 10:
Which of the following statements correctly defines a method in C#?
void MyMethod(int a, int b) { }void MyMethod(int a; int b) { }void MyMethod(int a, int b);void MyMethod(int a, int b)
Correct Answer: 1
Hoowdy jjust wanted to give you a quick heads upp and let yoou know
a few oof the imawges aren’t loading properly. I’m noot sure
wwhy but I think its a linking issue. I’ve tried iit in two different wweb
browzers annd both show the same outcome. xnxx
This piece off writing will help thhe internet people for setting uup
new weblog oor evven a weblog from start to end.
xnxx
Unquestionably bbelieve that which yyou stated. Your favorite reason appeared
to be on thee internet thhe easeiest thung to be aware
of. I say tto you, I certainly get irked while pwople consaider worries thaat they plainly do not
knoww about. You managed tto hhit the nasil upon thhe top and also defined out thhe
whole thing without having side effect , people can take a signal.
Wiill probably be ack to geet more. Thanks xnxx
Yoour way of describing aall iin this artcle iis truy fastidious,
all be capablle of withoutt difficulty know it, Thanks
a lot. xnxx