
csharp

Quiz
•
Computers
•
University
•
Medium
kalyani boyina
Used 3+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 1, j = 2, k = 3;
do
{
Console.WriteLine((Convert.ToBoolean(Convert.ToInt32(i++)))
&& (Convert.ToBoolean(Convert.ToInt32(++j))));
}while (i <= 3);
Console.ReadLine();
}
a) 0 0 0
b) True True True
c) 1 1 1
d) False False False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
float i = 1.0f, j = 0.05f;
do
{
Console.WriteLine(i++ - ++j);
}while (i < 2.0f && j <= 2.0f);
Console.ReadLine();
}
a) 0.05
b) -0.05
c) 0.95
d) -0.04999995
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 1, j = 5;
do
{
Console.WriteLine(i = i++ * j);
}while (i <= 10);
Console.ReadLine();
}
a) 5 10 15 20 25 30 35 40 45 50
b) 5 25
c) 5 11 16 21 26 31 36 41 46 51
d) 5 30
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
For the incomplete C# program below, which of the C# code fragment will not result in an infinite loop?
static void Main(string[] args)
{
int i = 1234 ,j = 0;
/*ADD CODE HERE */
Console.WriteLine(j);
}
a)
do { j = j + (i % 10); }while ((i = i / 10)!= 0);
b)
do { j = j + (i % 10); }while ((i / 10)!= 0);
c)
do { j = j + (i % 10); }while ((i % 10)!= 0);
d)
do { j = j + (i % 10); }while ((i/10 == 0)!= 0);
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
long x;
x = Convert.ToInt32(Console.ReadLine());
do
{
Console.WriteLine(x % 10);
}while ((x = x / 10) != 0);
Console.ReadLine();
}
enter x = 1234.
a) number of digits present in x
b) prints ‘1’
c) prints reverse of x
d) prints sum of digits of ‘x’
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
long x;
x = Convert.ToInt32(Console.ReadLine());
do
{
Console.WriteLine(x % 10);
}while ((x = x / 10) != 0);
Console.ReadLine();
}
enter x = 1234.
a) number of digits present in x
b) prints ‘1’
c) prints reverse of x
d) prints sum of digits of ‘x’
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for do while loop?
a)
do; { statement; }while (condition);
b)
do(condition) { statement; }while;
c)
do { statement; }while (condition)
d)
do { statement; }while (condition);
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
PracticeQuizVinodJain1

Quiz
•
University
15 questions
Java Programming

Quiz
•
University
10 questions
csharp

Quiz
•
University
20 questions
Fundamentos JAVA

Quiz
•
University
11 questions
JS: Conditionals!

Quiz
•
6th Grade - University
16 questions
Java Основи

Quiz
•
11th Grade - University
20 questions
Final Quiz

Quiz
•
University
10 questions
Third Year Placement Training Revision Test

Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University