ankitweblogic logo
W e b t u t o r i a l s

Visual Studio.NET IDE

Define C#.NET

C# Comment

C# Variables

C# Data Types

C# Escape Sequence

C# Operators

Exercise-1

Format String

Operator Precedence

C# Keywords

Constant Variable

Type Conversion

Flow Control

Exercise Loops & Nested Loop

C# Arrays

C# Strings

User-Define Methods

Variable Scope

C# Enumerations

C# Structure

C# Exception Handling

Object Oriented Programming

C# Classes

Constructor & Destructor

C# Inheritance

C# Polymorphism

C# Operator Overloading

C# Interface

Abstract Classes & Methods

Sealed Classes, Methods

C# Properties

C# Indexer

C# Delegates

C# Generics

C# Collection

System.Object

C#.Net Flow Control

Flow control can be categorized into 3 categories:
1. Selection Statements: Selection statements select one of a number of possible statements for execution based on the value of a controlling expression. Selection statements are of 2 types:
if statement: if statement selects a statement for execution based on the condition specified.
Switch statement: Switch statement executes the statements that are associated with the value of the controlling expression.

2. Iterations or Loops: Iterations are used to repeate execution of a statement or a set of statements. There are 4 types of Iterations:
For loop: Use to perform iteration i.e. repeat a block of instructions a given number of times.
While loop: Use to conditionally execute a set of statements zero or more time.
Do Loop: Use to conditionally execute a set of statements one or more time.
Foreach loop : Foreach loop is used to iterate through the collection to get the desired information.

3. Jumping Statements: Jumping statements are used to unconditionally transfer the control or it may transfer control out of a block. Jumping statements are of 3 types:
a. Break statement: Break statement exits the nearest enclosing switch, while, do, for or foreach loop.
b. Continue statement: Skips all the statements which are mentioned below continue keyword. Continue keyword is used inside a loop only.
c. Goto statement: The goto statement transfers the program control directly to a labeled statement.

Updated: 03-Feb-19