Search Header Logo

PracticeQuizVinodJain1

Authored by Vinod Jain

Computers

University

Used 1+ times

PracticeQuizVinodJain1
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

2 mins • 1 pt

What will be the output of given C# Code

static void Main(string[] args)

{

float f = 12;

int x = f;

Console.WriteLine("{0}", x);

}

(a) 12

(b) 12.0

(c) 0

(d) Syntax Error

A

B

C

D

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of given C# Code

static void Main(string[] args)

{

int f = 12;

float x = f;

Console.WriteLine("{0}", x);

Console.ReadKey();

}

(a) 12

(b) 12.0

(c) 0

(d) Syntax Error

A

B

C

D

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of given C# Code

static void Main(string[] args)

{

Object myBoxed = (Object) 12;

int myVal = myBoxed;

Console.WriteLine("{0}", myVal);

Console.ReadKey();

}

(a) 12

(b) 12.0

(c) 0

(d) Syntax Error

A

B

C

D

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of given C# Code

static void Main(string[] args)

{

Object myBoxed = (Object) 12;

int myUnBoxed = (int)myBoxed;

Console.WriteLine("{0}", myUnBoxed);

Console.ReadKey();

}

12
12.0
0
Syntax Error

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

enum Months

{

January,

February,

March = 6,

April,

May,

June,

July

}

static void Main(string[] args)

{

int myNum = (int)Months.June;

Console.WriteLine("{0}", myNum);

Console.ReadKey();

}

(a) 6

(b) 7

(c) 8

(d)None of these

A

B

C

D

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of given C# Code

static void Main(string[] args)

{

string str = "Happy";

for (int i = 0; i <str.Length; i=i+2)

Console.Write("{0}", str[i]);

Console.ReadKey(); Console.ReadKey();

}

Hap
Happy
Hpy
None of these

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of given C# Code

public static void Main(string[] args)

{

int[] arr = new int[5];

arr[0] = 1;

arr[2] = 2;

arr[4] = 3;

for (int i = 0; i < arr.Length; i++)

Console.Write(arr[i]);

Console.ReadKey();

}

123
10203
01020
None of these

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?