4 c# programming constructs
TRANSCRIPT
Selection Constructs
Selection Constructs
Switch…case http://pastebin.com/7kNQwQaY
The expression must be int, char, byte or short.
Loop Constructs
Selection Constructs
while (pre-test loop) http://pastebin.com/1WPRbaed
Selection Constructs
do-while(post-test loop) http://pastebin.com/jnNvyB07
Selection Constructs
for(post-test loop) https://gist.github.com/2318139
Selection Constructs
nested for
for(initial, condition, increment/decrement) {
for(initial, condition, increment/decrement)
{
….
} }
Selection Constructs
foreach https://gist.github.com/2318146
foreach(<datatype> <indentifier> in <list>) { }
Jump Statements
Break
is used in the selection and loop constructs.
http://pastebin.com/1ENSu2f9
Continue
mostly used in loop constructs.
end the current iteration of the loop and begin another
http://pastebin.com/QzZSVZhP
Goto
directly execute a labeled statement or a labeled block of statement cannot use goto inside for, while or do-while loops.
http://pastebin.com/1Pk2f7fE
Return