Tell us the difference between the while and for loop. Provide a .net syntax for both loops?



Tell us the difference between the while and for loop. Provide a .net syntax for both loops?..

Answer / Sunil Dutt

"While loop is a control structure that repeats a block of code as long as a specified condition is true, whereas a For loop is used to repeat a block of code a specific number of times. Syntax: While (condition) {n// Code to be executed n}nSyntax for For loop in C#: for(initialization; condition; increment/decrement) {n// Code to be executedn}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is the concept of inheritance in .net?

1 Answers  


What is 'Common Type System' (CTS) in .NET?

1 Answers   NA,


What is clr in .net?

1 Answers  


Is .net core the future?

1 Answers  


i have an array of 10 objects whose values are from 1-10 randomly inserted. i have deleted one array object. tell me what is that value? write the logic of it.

2 Answers   Deloitte, Srp Khanij,


Please explain what do the terms “boxing” and “unboxing” mean?

1 Answers  


Explain the features that are common to all .Net languages.

1 Answers   Accenture,


diff between forms authentication and windows authentication?

11 Answers  


What are good ADO.NET object(s) to replace the ADO Recordset object.

1 Answers  


Difference between value type & reference types ?

1 Answers  


What is the use of Treeview control?

1 Answers   CGI,


What are multicast delegates?

1 Answers  


Categories