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
10 questions
C++ vs Python: A Quiz Introduction
Quiz
•
11th Grade - University
10 questions
Java Basic Programming Quiz
Quiz
•
University
13 questions
UTSSKDP1
Quiz
•
University
12 questions
MS Core Java Quiz-2 2023
Quiz
•
University
10 questions
Talent Next Java MCQ-1
Quiz
•
University
14 questions
Lets explore Java
Quiz
•
University
15 questions
Basic Java Quiz
Quiz
•
University
9 questions
IPC144 SLG -- Week2
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade