C# Questions & Answers – Continue, Goto Statements

This section of our 1000+ C# multiple choice questions focuses on Continue and Goto Statements in C# Programming Language. 1. 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 … Read more

advertisement

C# Questions & Answers – Do While Loop Statements

This section of our 1000+ C# multiple choice questions focuses on do while loop statements in C# Programming Language. 1. 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(); … Read more

advertisement

C# Questions & Answers – While Loop Statements

This section of our 1000+ C# multiple choice questions focuses on while loop statements in C# Programming Language. 1. What will be the output of the following C# code? static void Main(string[] args) { int i, j; for (i = 1; i <= 3; i++) { j = 1; while (i % j == 2) … Read more

advertisement

C# Questions & Answers – For Loop Statements

This section of our 1000+ C# multiple choice questions focuses on for loop statements in C# Programming Language. 1. 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(); } a) No output b) hello c) hello printed … Read more

advertisement

C# Multiple Choice Questions – Switch Statement

This section of our 1000+ C# multiple choice questions focuses on switch statement in C# Programming Language. 1. What will be the output of the following C# code? static void Main(string[] args) { int movie = 1; switch (movie << 2 + movie) { default: Console.WriteLine("3 Idiots"); break; case 4: Console.WriteLine("Ghazini"); break; case 5: Console.WriteLine("Krishh"); … Read more

advertisement

C# Questions & Answers – IF Statements

This section of our 1000+ C# multiple choice questions focuses on relational and logical operators in C# Programming Language. 1. What will be the output of the following C# code? static void Main(string[] args) { int i = 30; int j = 25 % 25; if (Convert.ToBoolean(Convert.ToInt32(i = j))) { Console.WriteLine("In if"); } else { … Read more

advertisement

C# Questions & Answers – Bitwise and Conditional Operators

This set of C# Multiple Choice Questions & Answers focuses on “Bitwise and Conditional Operators”. 1. What will be the output of the following C# code? static void Main(string[] args) { byte varA = 10; byte varB = 20; long result = varA & varB; Console.WriteLine("{0} AND {1} Result :{2}", varA, varB, result); varA = … Read more

advertisement

C# Questions & Answers – Relational and Logical Operators

This section of our 1000+ C# multiple choice questions and answers focuses on relational and logical operators in C# Programming Language. 1. What will be the output of the following C# code? static void Main(string[] args) { int a = 4; int b = 5; int c = 6; int d = 8; if (((a … Read more

advertisement

C# Questions & Answers – Arithmetic Operators

This section of our 1000+ C# multiple choice questions focuses on arithmetic operators in C# Programming Language. 1. What will be the output of the following C# code? static void Main(string[] args) { float a = 16.4f; int b = 12; float c; c = a * ( b + a) / (a – b) … Read more

advertisement

C# Questions & Answers –Type Conversion in Expressions

This set of C# MCQs focuses on “Type Conversion in Expressions”. 1. What is the need for ‘Conversion of data type’ in C#? a) To store a value of one data type into a variable of another data type b) To get desired data c) To prevent situations of runtime error during change or conversion … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.