Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected typos in README #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ C is a types language. Every variable in C is assigned a distinct type that dict
| double | 8 |
| long double | 16 |

All variables must be declared before they are used. They must be declared at the top of a block, a
section of code enclosed in brackets { and }, before any statements.
All variables must be declared before they are used. They must be declared at the top of a block, a section of code enclosed in brackets { and }, before any statements.

### Signed and Unsigned variables

Expand All @@ -70,7 +69,7 @@ For example, a 16-bit signed short can represent the numbers −32768 to 32767 (

## Operators

The syntax for arithmetic and relational operators in C are similar to python in almost all cases. The logical operators in C are as follows:
The syntax for arithmetic and relational operators in C are similar to Python in almost all cases. The logical operators in C are as follows:

| Python | C |
| ------------- | ----------------- |
Expand All @@ -91,7 +90,7 @@ if (condition) {
}
```

The main difference between an if statement in Python and C is that In C the condition should be enclosed in an opening and closing parenthesis and the body should be enclosed in a opening and closing curly braces.
The main difference between an if statement in Python and C is that In C the condition should be enclosed in an opening and closing parenthesis and the body should be enclosed in opening and closing curly braces.

### if-else Ladder

Expand All @@ -116,7 +115,7 @@ else {
}
```

The applies to if-else ladder with the additional caveat that **elif** is replaced by **else if**.
The same applies to if-else ladder with the additional caveat that **elif** is replaced by **else if**.

### Conditional expression

Expand Down Expand Up @@ -151,7 +150,7 @@ In **switch** statement the block whose value gets matched to the value passed t

In Python the loops can be used as an iterator through different data structures, while in C this is not possible. In C, loops are used as a control structure to manage statements that are repeated. This also means that in C the exit and entry to the loop body are based on an expression evaluation.

In addition, C also offers a **do-while** loop. While the **for** loop and **while** loop are entry controlled - the condition to enter the loop body is checked in the beginning of the loop execution. The do-wile loops is exit controlled - the condition to enter the loop body is checked at the end of loop execution. Which means that the loop is executed at least once.
In addition, C also offers a **do-while** loop. While the **for** loop and **while** loop are entry controlled - the condition to enter the loop body is checked in the beginning of the loop execution, the do-while loops is exit controlled - the condition to enter the loop body is checked at the end of loop execution. Which means that the loop is executed at least once.

![loop](fig/forloop.png)

Expand Down