C Sharp Programming questions

1,499 questions

Practice questions from C Sharp Programming.

Filter questions

mediummultiple choiceVariables And Constants In C Sharp1 points
In C#, what is the result of the expression 3 / 2?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What will be the output of the following C# code? static void Main(string[] args) { int i; Console.WriteLine("enter value of i:"); i = Convert.ToInt32(Console.ReadLine()); if (i < 7) { i++; continue; } Console.WriteLine("final value of i:" +i); Console.ReadLine(); }
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
In C#, what is the syntax for a 'for' loop?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What is the result of the expression 10 % 2 == 0 ? "Even" : "Odd" in C#?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
Which loop in C# executes its body at least once, even if the condition is false?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
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(0xB))) if (Convert.ToBoolean(Convert.ToInt32(022))) if (Convert.ToBoolean(Convert.ToInt32('\xeb'))) Console.WriteLine("java"); else ; else ; else ; }
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What is the purpose of the 'if' statement in C#?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What is the result of the expression 7 % 4 in C#?
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What will be the output of the following C# code? static void Main(string[] args) { int a = 15, b = 10, c = 1; if (Convert.ToBoolean(a) && (b > c)) { Console.WriteLine("cquestionbank"); } else { break; } }
Points: 1
mediummultiple choiceControl Flow Statements In C Sharp1 points
What does the 'break' statement do in a loop in C#?
Points: 1

Want to track your progress?

A free account saves your quiz results and shows how you are doing over time.