PracticeQuizVinodJain1

PracticeQuizVinodJain1

University

10 Qs

quiz-placeholder

Similar activities

exception

exception

University

10 Qs

Java

Java

University

15 Qs

Java Method

Java Method

University

15 Qs

Basic Java Quiz

Basic Java Quiz

University

15 Qs

Lets explore Java

Lets explore Java

University

14 Qs

Java Basic 1

Java Basic 1

University

10 Qs

Java for Geeks and Dummies

Java for Geeks and Dummies

12th Grade - University

10 Qs

Java Exception Handling

Java Exception Handling

University

15 Qs

PracticeQuizVinodJain1

PracticeQuizVinodJain1

Assessment

Quiz

Computers

University

Medium

Created by

Vinod Jain

Used 1+ times

FREE Resource

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

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?