Search Header Logo

PU - Day 1 Assessment - Anand's batch

Authored by training atomm

Professional Development

Professional Development

Used 1+ times

PU - Day 1 Assessment - Anand's batch
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. int i;

  4. for (i = 0; ; )

  5. {

  6. Console.WriteLine("hello");

  7. }

  8. Console.ReadLine();

  9. }

The program will print 'hello' indefinitely.
The program will print 'hello' and then exit.
The program will print 'hello' once.
The program will not compile due to an error.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. int x = 5;

  4. if (x > 3)

  5. {

  6. Console.WriteLine("x is greater than 3");

  7. }

  8. Console.ReadLine();

  9. }

The program will print nothing.

The program will not compile due to an error.

The program will print 'x is less than or equal to 3'.

The program will print 'x is greater than 3'.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. for (int j = 0; j < 3; j++)

  4. {

  5. Console.WriteLine(j);

  6. }

  7. Console.ReadLine();

  8. }

The program will print 0, 1, 2.

The program will print nothing.

The program will print 1, 2, 3.

The program will print 0, 1, 2, 3.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. string str = null;

  4. Console.WriteLine(str.Length);

  5. Console.ReadLine();

  6. }

The program will print 0.

The program will throw a NullReferenceException.

The program will print 'null'.

The program will compile but print nothing.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. int I, X;

  4. for (I = 1; I <= (9 % 2 + I); I++)

  5. {

  6. X = (I 3 + I 2) / I;

  7. Console.WriteLine(X);

  8. }

  9. Console.ReadLine();

  10. }

Infinite loop printing 3
Prints 0 and exits
Infinite loop printing 5
Prints 1 to 9 sequentially

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. int a = 10;

  4. if (a == 10)

  5. {

  6. Console.WriteLine("a is 10");

  7. }

  8. Console.ReadLine();

  9. }

The program will print 'a is not 10'.

The program will throw an error.

The program will print 'a is 10'.

The program will print nothing.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

  1. static void Main(string[] args)

  2. {

  3. for (int i = 0; i < 5; i++)

  4. {

  5. if (i == 3)

  6. break;

  7. Console.WriteLine(i);

  8. }

  9. Console.ReadLine();

  10. }

The program will print 0, 1, 2, 3, 4.

The program will print nothing.

The program will print 0, 1, 2, 3.

The program will print 0, 1, 2.

Access all questions and much more by creating a free account

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

Already have an account?

Discover more resources for Professional Development