
csharp practice bits
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
kalyani boyina
Used 5+ times
FREE Resource
Enhance your content in a minute
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
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
20 questions
Web Development and Programming
Quiz
•
University
20 questions
data structures1
Quiz
•
University
16 questions
Quiz on List and Tuples
Quiz
•
University
15 questions
OS Quiz-1
Quiz
•
University
20 questions
Week 5: Test your understanding part 1
Quiz
•
University
15 questions
Digital Etiquette
Quiz
•
4th Grade - University
15 questions
Data Mining - Classification Mining
Quiz
•
University
15 questions
python basics
Quiz
•
11th Grade - 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
