DOT NET-SET1
Quiz
•
Computers
•
Professional Development
•
Hard
V PERUMAL
Used 12+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Select the output for the following set of code:
1. static void Main(string[] args)
2. {
3. int y = 5;
4. int x;
5. int k = (!(Convert.ToInt32(y) > 10))? x = y + 3 : x = y + 10;
6. Console.WriteLine(x);
7. Console.WriteLine(y);
8. Console.ReadLine();
9. }
5, 8
8, 5
11, 8
10, 4
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Give the Correct Output for the given set of programming code is :
1. class Program
2. {
3. static void Main(string[] args)
4. {
5. int i ;
6. for ( i = 0; i < 5; i++)
7. {
8. int j = 0;
9. j += i;
10. Console. WriteLine(j);
11. }
12. Console. WriteLine(i);
13. Console. ReadLine();
14. }
15. }
0, 1, 2, 3, 4, 5, 6
0, 1, 2, 3, 4
0, 1, 2, 3, 4, 5
0, 1, 2, 3
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Select the output for the following set of Code :
1. static void Main(string[] args)
2. {
3. int a = -1;
4. int b = -1;
5. if (Convert.ToBoolean (++a = ++b))
6. Console.WriteLine("a");
7. else
8. Console.WriteLine("b");
9. Console.ReadLine();
10. }
a
b
Compile time error
Code execute successfully with no output
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1. static void Main(string[] args)
2. {
3. int x;
4. x = Convert.ToInt32(Console.ReadLine());
5. int c = 1;
6. while (c <= x)
7. {
8. if (c % 2 == 0)
9. {
10. Console.WriteLine("Execute While " + c + "\t" + "time");
11. }
12. c++;
13. }
14. Console.ReadLine();
15. }
for x = 8
Execute while 1 time Execute while 3 time Execute while 5 time Execute while 7 time
Execute while 2 time Execute while 4 time Execute while 6 time Execute while 8 time
Execute while 1 time Execute while 2 time Execute while 3 time Execute while 4 time Execute while 5 time Execute while 6 time Execute while 7 time
Execute while 2 time Execute while 3 time Execute while 4 time Execute while 5 time
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Select the output for the following set of code :
1. static void Main(string[] args)
2. {
3. int i = 0;
4. int j = 0;
5. for (i = 0; i < 4; i++)
6. {
7. for (j = 0; j < 3; j++)
8. {
9. if (i > 1)
10. continue;
11. Console.WriteLine("Hi \n");
12. }
13. }
14. Console.ReadLine();
15. }
Prints hi 4 times
Prints hi 3 times
Prints hi 6 times
Prints hi infinite times
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Select the output for the following set of code :
1. class sample
2. {
3. public int i;
4. public int j;
5. public void fun(int i, int j)
6. {
7. this.i = i;
8. this.j = j;
9. }
10. }
11. class Program
12. {
13. static void Main(string[] args)
14. {
15. sample s = new sample();
16. s.i = 1;
17. s.j = 2;
18. s.fun(s.i, s.j);
19. Console.WriteLine(s.i + " " + s.j);
20. Console.ReadLine();
21. }
22. }
Error while calling s.fun() due to inaccessible level
Error as ‘this’ reference would not be able to call ‘i’ and ‘j’
1 2
Runs successfully but prints nothing
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Select the correct output for the following code
1. class z
2. {
3. public int X;
4. public int Y;
5. public const int c1 = 5;
6. public const int c2 = c1 * 25;
7. public void set(int a, int b)
8. {
9. X = a;
10. Y = b;
11. }
12.
13. }
14. class Program
15. {
16. static void Main(string[] args)
17. {
18. z s = new z();
19. s.set(10, 20);
20. Console.WriteLine(s.X + " " + s.Y);
21. Console.WriteLine(z.c1 + " " + z.c2);
22. Console.ReadLine();
23. }
24. }
10 20 5 25
20 10 25 5
10 20 5 125
20 10 125 5
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
16 questions
Digital etiquette
Quiz
•
KG - Professional Dev...
20 questions
Web Application Security Testing-PreTest
Quiz
•
Professional Development
17 questions
Salesforce Admin WI22
Quiz
•
Professional Development
10 questions
2. Operator, Standard input
Quiz
•
Professional Development
15 questions
Linked List
Quiz
•
Professional Development
20 questions
Excel 2016
Quiz
•
6th Grade - Professio...
10 questions
Pretest (MS Word)
Quiz
•
Professional Development
10 questions
PDS - 04225 Pointers & Dynamic Arrays - Chapter 8
Quiz
•
University - Professi...
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween
Quiz
•
Professional Development
16 questions
Spooky Season Quiz
Quiz
•
Professional Development
5 questions
11.4.25 Student Engagement & Discourse
Lesson
•
Professional Development
50 questions
ASL Colors and Clothes
Quiz
•
KG - Professional Dev...
15 questions
Ohms Law
Quiz
•
Professional Development
10 questions
Halloween Trivia
Quiz
•
Professional Development
10 questions
Halloween Trivia
Quiz
•
Professional Development
