What will be the output of the following C# code?
static void Main(string[] args)
{
int a, b, c, x;
a = 80;
b = 15;
c = 2;
x = a - b / (3 c) ( a + c);
Console.WriteLine(x);
Console.ReadLine();
}
C#.net test 1
Quiz
•
Computers
•
University
•
Hard
SUNITA YADAV
Used 12+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int a, b, c, x;
a = 80;
b = 15;
c = 2;
x = a - b / (3 c) ( a + c);
Console.WriteLine(x);
Console.ReadLine();
}
78
-84
80
98
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C# code?
m = 5; int y;
y = m++;
y = ++m;
y = 5, m = 6; y = 7, m = 7
y = 6, m = 6; y = 7, m = 6
y = 5, m = 6 ; y = 5, m = 5
y = 5, m = 6; y = 7, m = 8
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following C# code?
bool a = true;
bool b = false;
a |= b;
Console.WriteLine(a);
Console.ReadLine();
0
1
True
False
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int a = 5, b = 10;
if (Convert.ToBoolean(Convert.ToInt32(++a)) || Convert.ToBoolean(Convert.ToInt32(++b))) {
Console.WriteLine(a + "\n" + b);
}
else
Console.WriteLine(" C# ");
}
6 11
6 16
6 12
6 10
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
char ch = 'p';
switch (ch)
{
case 'p':
Console.WriteLine("coco" + "\t" + Convert.ToInt32(ch));
break;
default:
Console.WriteLine("default");
break;
}
Console.WriteLine("main");
}
coco main
coco 112
coco 112 main
compile time error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 0;
if (i == 0)
{
goto label;
}
label: Console.WriteLine("HI...");
Console.ReadLine();
}
Hi…infinite times
Code runs prints nothing
Hi Hi
Hi…
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is used to define the member of a class externally?
:
::
#
none of the mentioned
15 questions
C# Structured, Selection and Iteration
Quiz
•
9th Grade - University
10 questions
PracticeQuizVinodJain1
Quiz
•
University
10 questions
Python Basics
Quiz
•
University
10 questions
JS Quiz
Quiz
•
University
15 questions
Java Quiz based on array
Quiz
•
University
10 questions
Third Year Placement Training Revision Test
Quiz
•
University
15 questions
C# intro and methods
Quiz
•
University
15 questions
Java Programming
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