LEARN DOT NET

C# - Conditional Statements

Control Statemenst are Classifed into 3 Types

1. Branching Statements

Syntax :
if < Condition > { Statements } else { statements } If the condition is satisfied the if branch of the statements Executed otherwise the else branch of the statements executed ultimately any one of the branch excuted 2.While and For is Looping Statements Syntax of While : initialization; while <Condition > { statements reinitialization } Ex : i=1; while(i < = 10) { --- i++; } Syntax for For Loop: for(initialization;condition;reinitialization) { } Example: for(i=1;i<=10;i++{ }
3 Jumping statements
Example :
switch(exp)
{
case 1:
case 2:
case 3:
default:
}