Skip to content

Commit f770378

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2462 from BeardedFish/master
Added syntax highlighting to C code examples
2 parents f483c15 + 4a75425 commit f770378

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/c-language/break-statement-c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Within nested statements, the **`break`** statement terminates only the **`do`**
2020

2121
This example illustrates the **`break`** statement:
2222

23-
```
23+
```C
2424
#include <stdio.h>
2525
int main() {
2626
char c;

docs/c-language/compound-statement-c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Variables declared in a block with the **`auto`** or **`register`** keyword are
3131

3232
This example illustrates a compound statement:
3333

34-
```
34+
```C
3535
if ( i > 0 )
3636
{
3737
line[i] = x;

docs/c-language/continue-statement-c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The next iteration of a **`do`**, **`for`**, or **`while`** statement is determi
2222

2323
This is an example of the **`continue`** statement:
2424

25-
```
25+
```C
2626
while ( i-- > 0 )
2727
{
2828
x = f( i );

docs/c-language/if-statement-c.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In the first form of the syntax, if *expression* is true (nonzero), *statement*
2222

2323
The following are examples of the **`if`** statement:
2424

25-
```
25+
```C
2626
if ( i > 0 )
2727
y = x / i;
2828
else
@@ -36,7 +36,7 @@ In this example, the statement `y = x/i;` is executed if `i` is greater than 0.
3636

3737
When nesting **`if`** statements and **`else`** clauses, use braces to group the statements and clauses into compound statements that clarify your intent. If no braces are present, the compiler resolves ambiguities by associating each **`else`** with the closest **`if`** that lacks an **`else`**.
3838

39-
```
39+
```C
4040
if ( i > 0 ) /* Without braces */
4141
if ( j > i )
4242
x = j;
@@ -46,7 +46,7 @@ if ( i > 0 ) /* Without braces */
4646

4747
The **`else`** clause is associated with the inner **`if`** statement in this example. If `i` is less than or equal to 0, no value is assigned to `x`.
4848

49-
```
49+
```C
5050
if ( i > 0 )
5151
{ /* With braces */
5252
if ( j > i )

0 commit comments

Comments
 (0)