fix(guide): Fix all frontmatter

This commit is contained in:
Bouncey
2018-10-19 13:53:51 +01:00
committed by Stuart Taylor
parent 569bd7c3a7
commit 6d511c558a
146 changed files with 926 additions and 1469 deletions

View File

@ -1,5 +1,5 @@
---
title:Switch Statement
title: Switch Statement
---
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case.
@ -12,7 +12,7 @@ switch(expression) {
case constant-expression :
statement(s);
break; //optional
// you can have any number of case statements.
default : //Optional
statement(s);
@ -38,14 +38,14 @@ Example:
```C++
#include <iostream>
using namespace std;
int main () {
// local variable declaration:
char grade = 'D';
switch(grade) {
case 'A' :
cout << "Excellent!" << endl;
cout << "Excellent!" << endl;
break;
case 'B' :
case 'C' :
@ -61,7 +61,7 @@ int main () {
cout << "Invalid grade" << endl;
}
cout << "Your grade is " << grade << endl;
return 0;
}```