Skip to content

Commit a2071c4

Browse files
Update README.md
1 parent 99c0af3 commit a2071c4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ To gain a solid understanding of Operators, System Input/Output, Conditional Sta
1111
2. Write a calculator program `calculator.c` that prompts the user with a menu for operations (+, -, *, /, %), takes in 2 numbers, and performs the selected operation. The menu selection should be interpreted using a switch statement. You may assume the user will enter any 2 valid numbers.
1212

1313
3. Write a random number guesser `randnum.c` that generates a random integer between 1 and 10 (inclusive), prompts the user for a guess, and tells the user if they guessed correctly, too high, or too low. You may assume the user enters a valid integer. The code below will generate a random integer. Note: You will need to include the stdlib.h and time.h header files.
14-
```c
15-
srand(time(0));
16-
int r = rand();
17-
```
14+
```c
15+
srand(time(0));
16+
int r = rand();
17+
```
1818
1919
### Part 2
2020
In a text file `assignment2.txt`, answer the following questions:
@@ -24,10 +24,14 @@ In a text file `assignment2.txt`, answer the following questions:
2424
2. What are logical errors and how are they different from syntax errors?
2525
2626
3. What is the outcome of the following conditional statement if the value of variable x is 10?
27-
```x > = 10 && x < 25 && x != 12```
27+
```
28+
x > = 10 && x < 25 && x != 12
29+
```
2830
2931
4. Is the following expression valid? Why or why not?
30-
```0 < x < 15 ```
32+
```
33+
0 < x < 15
34+
```
3135
3236
5. Which of the following are valid? What is wrong with any that are invalid?
3337
1. if (a > b) then c = 0;

0 commit comments

Comments
 (0)