
csharp
Authored by kalyani boyina
Computers
University
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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);
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
19 questions
Programación Básica Prácticas Tema 2
Quiz
•
University
12 questions
Microsoft Office Word
Quiz
•
4th Grade - University
17 questions
Kiến thức về trang tính
Quiz
•
7th Grade - University
16 questions
E-Commerce
Quiz
•
University - Professi...
20 questions
Control Structures C#
Quiz
•
University
20 questions
jak dobrze znasz Minecraft?
Quiz
•
1st Grade - Professio...
15 questions
Object Oriented Programming Assessment 1
Quiz
•
University
10 questions
Capa de red
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade