Posts

do while loop in C#

  1. do- while loop:   à The do while loop is the same as while loop except that it executes the code block at least once.   à do while loop is similar to while loop with the only difference that it checks the condition after executing the statements or block of code. i.e. it will execute the loop body one time for sure because it checks the condition after executing the statements.   à It is similar to the while loop but the while loop has the test condition at the start of the loop and the do while loop has the test condition at the end of the loop. So, it executes at least once always.   à Within a do-while, continue  and  break  statements to control the flow of execution in the loop.   Syntax: do { //block of code     // These statements will be executed if the condition            evaluates to true   // always execute once } wh...

while loop in C#

  1. while loop: The test condition is given in the beginning of the loop and all statements are executed till the given Boolean condition satisfies. when the condition becomes false, the control will be out from the while loop.   If the number of iterations is not fixed, it is recommended to use while loop than for loop.   Syntax: while (boolean condition) {    loop statements } Examples: 1.    Basic condition. 2.    Nested while loop.

For loop

  Condition Looping: à Loops are used to execute one or more statements multiple times until a specified condition is fulfilled. à Loops can be nested in C#.   C# provides 4 loops that allow you to execute a block of code repeatedly until a certain condition is met; they are:   1.    for Loop. 2.    while loop. 3.    do while Loop. 4.    foreach Loop.   Each and every loop requires the following 3 things in common.   Initialization : that sets a starting point of the loop.   Condition : that sets an ending point of the loop.   Iteration : that provides each level, the iterator defines the incremental or decremental of the loop variable. 1. for loop: The for keyword indicates a loop in C#.   The for loop executes a block of statements repeatedly until the specified condition returns false.     The ...

.NET Framework Introducton

  Definition: .NET framework is a software development framework introduced by Microsoft for building different types of applications i.e. console applications, windows application, web applications and mobile applications etc. The first version of .Net framework was 1.0 which came in the year 2002.   .NET Framework Features / Characteristics:- 1. .NET stands for ‘Network enabled technology’. 2. Easy development of different types of applications. 3. Rapid application development. 4. Multi-Language support with asynchronous    programming. 5. Object oriented programming (OOPS) support. 6. Loosely coupling and extensible architecture. 7. Easy and rich debugging support. 8. Memory management and security. .NET FRAMEWORK ARCHITECTURE:-   The .NET Framework is composed of four main components:   1.    Common Language Runtime (CLR).   2.    Framework Class Library (FCL).   3.    ...

Conditional Statement in C#

  Condition Statement: A statement that can be executed based on a condition is known as a “Conditional Statement”.   The statement is often a block of code.   The following are the 2 types: Conditional Branching. Conditional Looping.         Conditional Branching: This statement allows you to branch your code depending on whether or not a certain condition is met.   In C# are the following conditional branching statements:   1.    if statement.   2.    if-else statement.   3.    if-else-if ladder statement.   4.    Nested if statement.   5.    switch case statement.   Here if, else and switch are pre-defined keywords.         1.   if Statement: If statement checks the given Boolean condition. If the Boolean condition evaluates to be true then the block of code/statements will...