
csharp practice bits

Quiz
•
Computers
•
University
•
Hard
kalyani boyina
Used 5+ times
FREE Resource
20 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;
for (i = 0; ; )
{
Console.WriteLine("hello");
}
Console.ReadLine();
}
No output
hello
hello printed infinite times
Code will give error as expression syntax
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
float f;
for (f = 0.1f; f <= 0.5; f += 1)
Console.WriteLine( ++f );
Console.ReadLine();
}
1.1
0.1
0.1 0.2 0.3 0.4 0.5
None of the mentioned
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, X;
for (I = 1; I <= (9 % 2 + I); I++)
{
X = (I 3 + I 2) / I;
Console.WriteLine(X);
}
Console.ReadLine();
}
Output of code is 5 10
Output is 5 5 5 5
Print 5 infinite times
None of the mentioned
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int I, J = 0;
for (I = 1; I < 10; ) ;
{
J = J + I;
I += 2;
}
Console.WriteLine("Sum of first 10 even numbers is:"+J);
Console.ReadLine();
}
1 2 3 4 5 6 7 8 9
25
1
Run time error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 5;
for (; Convert.ToBoolean(Convert.ToInt32(i)); Console.WriteLine(i--)) ;
Console.ReadLine();
}
4 3 2 1
3 2 1
5 4 3 2 1
2 1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code?
static void Main(string[] args)
{
int i, s = 0;
for (i = 1; i <= 10; s = s + i, i++);
{
Console.WriteLine(s);
}
Console.ReadLine();
}
Code report error
Code runs in infinite loop condition
Code gives output as 0 1 3 6 10 15 21 28 36 45
Code give output as 55
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which statement is correct among the mentioned statements?
i. The for loop works faster than a while loop
ii. for( ; ; )implements an infinite loop
Only i is correct
Only ii is correct
Both i and ii are correct
Both i and ii are incorrect
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Java Programming Quiz

Quiz
•
University
20 questions
Multithreading in java

Quiz
•
University
15 questions
Объектно-событийная модель работы программы

Quiz
•
University
15 questions
PYTHON BOOTCAMP

Quiz
•
University
20 questions
Basic Python

Quiz
•
University
20 questions
Web Development and Programming

Quiz
•
University
15 questions
csharp

Quiz
•
University
16 questions
1°DS _AV2_R2 1TEC_IP_Introd. e Conceitos Básicos de JavaScript

Quiz
•
11th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University