Javatpoint.com is changed to TpointTech.com
C# switchThe C# switch statement executes one statement from multiple conditions. It is like if-else-if ladder statement in C#. Syntax: C# Switch ExampleOutput: Enter a number: 10 It is 10 Output: Enter a number: 55 Not 10, 20 or 30 Note: In C#, break statement is must in switch cases.Next TopicC# For Loop |
Javatpoint.com is now changed to TpointTech.com, so we request you to subscribe our newsletter for further updates.
The C# do-while loop is used to iterate a part of the program several times. If the number of iteration is not fixed and you must have to execute the loop at least once, it is recommended to use do-while loop. The C# do-while loop is executed...
3 min read
In C#, while loop is used to iterate a part of the program several times. If the number of iteration is not fixed, it is recommended to use while loop than for loop. Syntax: while(condition){ //code to be executed } Flowchart: Example Let's see a simple example of while loop to print...
3 min read
The C# for loop is used to iterate a part of the program several times. If the number of iteration is fixed, it is recommended to use for loop than while or do-while loops. The C# for loop is same as C/C++. We can initialize variable, check...
2 min read
In C# programming, the if statement is used to test the condition. There are various types of if statements in C#. if statement if-else statement nested if statement if-else-if ladder C# IF Statement The C# if statement tests the condition. It is executed if condition is true. Syntax: if(condition){ //code to be executed } C# If Example using...
5 min read
Statement The C# break is used to break loop or switch statement. It breaks the current flow of the program at the given condition. In case of inner loop, it breaks only inner loop. Syntax: jump-statement; break; Flowchart: Statement Example Let's see a simple example of C# break...
2 min read
Statement The C# goto statement is also known jump statement. It is used to transfer control to the other part of the program. It unconditionally jumps to the specified label. It can be used to transfer control from deeply nested loop or switch case label. Currently, it is...
1 min read
Statement The C# continue statement is used to continue loop. It continues the current flow of the program and skips the remaining code at specified condition. In case of inner loop, it continues only inner loop. Syntax: jump-statement; continue; Statement Example using System; public class ContinueExample ...
2 min read
The C# comments are statements that are not executed by the compiler. The comments in C# programming can be used to provide explanation of the code, variable, method or class. By the help of comments, you can hide the program code also. There are two types of...
2 min read
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India