# C++(if else,switch)

Python if else:

```python
Traffic_light = 'r'

if Traffic_light = 'r':
    print('red')
elif Traffic_light = 'g':
    print('green')
else:
    print('yellow')
```

C++ if else

```cpp
#include<iosstream>
int main(){
    char Traffic_light = 'r';

    if(Traffic_light = 'r') {
    std::cout<<'red'<<'\n';
    }
    else if(Traffic_light = 'g') {
    std::cout<<'green'<<'\n';
    }
    else {
    std::cout<<'yellow'<<'\n';
    }
    return 0;
}
```

C++ switch

```cpp
#include<iostream>

int main() {
    char Traffic_light = "r";
    
    switch (Traffic_light) {
    case "r":
        std::cout << "red" << std::endl;
        break;
    case "g":
        std:;cout << "green" << std::endl;
        break;
    }
    
    std::cout << "Traffic light is" << Traffic_light << std::endl;
    
    return 0;
}
```
