Control Statements Syntax
Divided Into Two Parts
1.Branching
2.Looping
1.Branching:
1.If
If(Condition)
{
}
2.If-else
If(Condition)
{
}
else
{
}
3.Nested If-else
If(Condition)
{
}
else if(condition)
{
}
else
{
}
4.Switch
Switch(a)
{
Case 0:
//Instructions;
break;
Case 1:
//Instructions;
break;
}
2.Looping
1.For
for(initilization ; condition ; increment/decrement)
{
//Body(Instructions)
}
2.While(conditions)
{
//Body(Instructions)
}
3.Do-While
do
{
}
while(condition);
Divided Into Two Parts
1.Branching
2.Looping
1.Branching:
1.If
If(Condition)
{
}
2.If-else
If(Condition)
{
}
else
{
}
3.Nested If-else
If(Condition)
{
}
else if(condition)
{
}
else
{
}
4.Switch
Switch(a)
{
Case 0:
//Instructions;
break;
Case 1:
//Instructions;
break;
}
2.Looping
1.For
for(initilization ; condition ; increment/decrement)
{
//Body(Instructions)
}
2.While(conditions)
{
//Body(Instructions)
}
3.Do-While
do
{
}
while(condition);
No comments:
Post a Comment