C – Control Statements (JNNC Technologies)


Conditional StatementsDescription
If StatementIf statement is a conditional branching statement. In conditional branching statement a condition is evaluated, if it is evaluate true a group of statement is executed.
Switch StatementSwitch statements simulate the use of multiple if statement.The switch statement is probably the single most syntactically awkward and error-prone feature of the C language.
Goto StatementThe goto statement is used to alter the normal sequence of program execution by transferring control to some other part of the program unconditionally.
For loopFor loop in C is the most general looping construct. The loop header contains three parts: an initialization, a continuation condition, and step.
While loopThe while statement is also a looping statement. The while loop evaluates the test expression before every loop, so it can execute zero times if the condition is initially false.
Do-While loopIs also used for looping. In this case the loop condition is tested at the end of the body of the loop. Hence the loop is executed at least one.
Break StatementThe break statement is a jump instruction and can be used inside a switch construct, for loop, while loop and do-while loop.
Continue StatementContinue statement is a jump statement. The continue statement can be used only inside for loop, while loop and do-while loop.
Nested LoopIn many cases we may use loop statement inside another looping statement. This type of looping is called nested loop.

0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();