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
PracticeQuizVinodJain1
Quiz
•
Computers
•
University
•
Medium
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();
}
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();
}
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();
}
10 questions
java operators
Quiz
•
University
10 questions
Quiz 8: Arrays&Vector
Quiz
•
University
15 questions
Java Quiz based on array
Quiz
•
University
9 questions
Java Programming Structures
Quiz
•
University
10 questions
Latihan1
Quiz
•
University
10 questions
Java Static
Quiz
•
University
10 questions
C Program Array and strings
Quiz
•
University
10 questions
Inheritance
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade