4 c# programming constructs

Post on 10-May-2015

1.257 Views

Category:

Technology

9 Downloads

Preview:

Click to see full reader

TRANSCRIPT

C# programming Constructs

tnngo2@gmail.com

Programming in C#

Selection Constructs

Selection Constructs

if…else…if http://pastebin.com/cRw1mL1d

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

top related