7. C# - Switch Case & LOOPS
SWITCH:
switch (variable)
{
case (condition):
do something
break;
case (condition):
do something
break;
default:
break;
}
FOR LOOPS (LIKE GOLANG)
for (conditions)
{
do something
}
FOREACH LOOP (LIKE GOLANG, ARRAY LOOP WITH INDEX AND ELEMENT)
foreach (char i in variableArray)
do something with i
WHILE LOOPS
while (condition)
{
do something
DO WHILE // does the check after doing it atleast once
do {
do something
} while (condition);
}
Comments
Post a Comment