C#.net test 1

C#.net test 1

University

10 Qs

quiz-placeholder

Similar activities

GAME QUIZ!!

GAME QUIZ!!

University

15 Qs

Operating System -Quiz-1

Operating System -Quiz-1

University

10 Qs

Web-II-Loop and Function

Web-II-Loop and Function

University

10 Qs

Java Quiz 3

Java Quiz 3

University

15 Qs

C++ 2nd Online Quiz

C++ 2nd Online Quiz

University

10 Qs

Hackclub

Hackclub

University

14 Qs

สิทธิและความรับผิดชอบ (Digital Right)

สิทธิและความรับผิดชอบ (Digital Right)

University

10 Qs

Quiz 1 - Intro to C#

Quiz 1 - Intro to C#

University

10 Qs

C#.net test 1

C#.net test 1

Assessment

Quiz

Computers

University

Hard

Created by

SUNITA YADAV

Used 13+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C# code?

  1. static void Main(string[] args)

  2. {

  3. int a, b, c, x;

  4. a = 80;

  5. b = 15;

  6. c = 2;

  7. x = a - b / (3 c) ( a + c);

  8. Console.WriteLine(x);

  9. Console.ReadLine();

  10. }

78

-84

80

98

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C# code?

m = 5; int y;

y = m++;

y = ++m;

y = 5, m = 6; y = 7, m = 7

y = 6, m = 6; y = 7, m = 6

y = 5, m = 6 ; y = 5, m = 5

y = 5, m = 6; y = 7, m = 8

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the following C# code?

  1. bool a = true;

  2. bool b = false;

  3. a |= b;

  4. Console.WriteLine(a);

  5. Console.ReadLine();

0

1

True

False

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C# code?

  1. static void Main(string[] args)

  2. {

  3. int a = 5, b = 10;

  4. if (Convert.ToBoolean(Convert.ToInt32(++a)) || Convert.ToBoolean(Convert.ToInt32(++b))) {

  5. Console.WriteLine(a + "\n" + b);

  6. }

  7. else

  8. Console.WriteLine(" C# ");

  9. }

6 11

6 16

6 12

6 10

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C# code?

  1. static void Main(string[] args)

  2. {

  3. char ch = 'p';

  4. switch (ch)

  5. {

  6. case 'p':

  7. Console.WriteLine("coco" + "\t" + Convert.ToInt32(ch));

  8. break;

  9. default:

  10. Console.WriteLine("default");

  11. break;

  12. }

  13. Console.WriteLine("main");

  14. }

coco main

coco 112

coco 112 main

compile time error

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C# code?

  1. static void Main(string[] args)

  2. {

  3. int i = 0;

  4. if (i == 0)

  5. {

  6. goto label;

  7. }

  8. label: Console.WriteLine("HI...");

  9. Console.ReadLine();

  10. }

Hi…infinite times

Code runs prints nothing

Hi Hi

Hi…

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is used to define the member of a class externally?

:

::

#

none of the mentioned

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?