C Programming c2
C Programming c2
**Decision Making:**
1. **Simple if statement:**
```c
if (condition) {
```
2. **if...Else statement:**
```c
if (condition) {
} else {
```
```c
if (condition1) {
if (condition2) {
} else {
```
4. **Else if ladder:**
```c
if (condition1) {
} else if (condition2) {
} else {
```
5. **Switch-Case statement:**
```c
switch (expression) {
case value1:
break;
case value2:
break;
default:
```
6. **? : Operator:**
```c
```
1. **While statement:**
```c
while (condition) {
```
2. **Do statement:**
```c
do {
// Code to execute at least once
} while (condition);
```
3. **For statement:**
```c
```
4. **Jumps in loops:**
- **Break:**
```c
while (condition) {
// Code
if (some_condition) {
// More code
```
- **Continue:**
```c
for (int i = 0; i < 10; i++) {
if (i == 5) {
continue; // Skips the rest of the loop and moves to the next iteration
```
- **Goto statement:**
```c
// Code
if (some_condition) {
// More code
label:
```