PU - Day 1 Assessment - Anand's batch

PU - Day 1 Assessment - Anand's batch

Professional Development

10 Qs

quiz-placeholder

Similar activities

Python Looping

Python Looping

Professional Development

9 Qs

python file handling

python file handling

Professional Development

10 Qs

Software Development Quiz

Software Development Quiz

6th Grade - Professional Development

10 Qs

Quiz 2 Internship on Fundamentals of Python

Quiz 2 Internship on Fundamentals of Python

Professional Development

15 Qs

Python Quiz : Loop

Python Quiz : Loop

Professional Development

13 Qs

HADOOP | PIG LATIN

HADOOP | PIG LATIN

University - Professional Development

9 Qs

PU Day 1 assessments - Srinivas's batch

PU Day 1 assessments - Srinivas's batch

Professional Development

10 Qs

operators in python

operators in python

Professional Development

14 Qs

PU - Day 1 Assessment - Anand's batch

PU - Day 1 Assessment - Anand's batch

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

training atomm

Used 1+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?