csharp

csharp

University

15 Qs

quiz-placeholder

Similar activities

C#.net test 1

C#.net test 1

University

10 Qs

Java Programming RBVRRIT

Java Programming RBVRRIT

University - Professional Development

10 Qs

Basics Of C Programming

Basics Of C Programming

University

10 Qs

Object Oriented Programming Quizz

Object Oriented Programming Quizz

University

10 Qs

Java Quiz - 1

Java Quiz - 1

University

15 Qs

Weekly Contest #3 - TechXNinjas

Weekly Contest #3 - TechXNinjas

University

10 Qs

CODE ZENITH

CODE ZENITH

University

15 Qs

Sains Komputer (Java) 1: Sintaks Asas & Pembolehubah

Sains Komputer (Java) 1: Sintaks Asas & Pembolehubah

10th Grade - University

10 Qs

csharp

csharp

Assessment

Quiz

Computers

University

Medium

Created by

kalyani boyina

Used 3+ times

FREE Resource

15 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 = 1, j = 2, k = 3;

  4. do

  5. {

  6. Console.WriteLine((Convert.ToBoolean(Convert.ToInt32(i++)))

  7. && (Convert.ToBoolean(Convert.ToInt32(++j))));

  8. }while (i <= 3);

  9. Console.ReadLine();

  10. }

a) 0 0 0


b) True True True

c) 1 1 1

d) False False False

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. float i = 1.0f, j = 0.05f;

  4. do

  5. {

  6. Console.WriteLine(i++ - ++j);

  7. }while (i < 2.0f && j <= 2.0f);

  8. Console.ReadLine();

  9. }

a) 0.05


b) -0.05

c) 0.95

d) -0.04999995

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. int i = 1, j = 5;

  4. do

  5. {

  6. Console.WriteLine(i = i++ * j);

  7. }while (i <= 10);

  8. Console.ReadLine();

  9. }

a) 5 10 15 20 25 30 35 40 45 50


b) 5 25

c) 5 11 16 21 26 31 36 41 46 51

d) 5 30

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

For the incomplete C# program below, which of the C# code fragment will not result in an infinite loop?

  1. static void Main(string[] args)

  2. {

  3. int i = 1234 ,j = 0;

  4. /*ADD CODE HERE */

  5. Console.WriteLine(j);

  6. }

a)

do { j = j + (i % 10); }while ((i = i / 10)!= 0);

b)

do { j = j + (i % 10); }while ((i / 10)!= 0);

c)

do { j = j + (i % 10); }while ((i % 10)!= 0);

d)

do { j = j + (i % 10); }while ((i/10 == 0)!= 0);

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. long x;

  4. x = Convert.ToInt32(Console.ReadLine());

  5. do

  6. {

  7. Console.WriteLine(x % 10);

  8. }while ((x = x / 10) != 0);

  9. Console.ReadLine();

  10. }

  11. enter x = 1234.

a) number of digits present in x


b) prints ‘1’

c) prints reverse of x

d) prints sum of digits of ‘x’

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. long x;

  4. x = Convert.ToInt32(Console.ReadLine());

  5. do

  6. {

  7. Console.WriteLine(x % 10);

  8. }while ((x = x / 10) != 0);

  9. Console.ReadLine();

  10. }

  11. enter x = 1234.

a) number of digits present in x


b) prints ‘1’

c) prints reverse of x

d) prints sum of digits of ‘x’

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for do while loop?

a)

do; { statement; }while (condition);

b)

do(condition) { statement; }while;

c)

do { statement; }while (condition)

d)

do { statement; }while (condition);

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?