Computer_Science_Assignment_Solved
Computer_Science_Assignment_Solved
3. **Character Constants:** Single characters enclosed in single quotes (e.g., 'A', '9').
3. **Control Instructions:** Used to control the flow of the program (e.g., if, for, while).
3. Draw the flow-chart of the program which creates the Simple Interest.
1. Start
5. End.
4. What is Algorithm? Write an algorithm for the program of the Fibonacci Series.
1. Start
4. Print a, b.
a. c = a + b
b. Print c
c. Update a = b, b = c
6. End.
Loops are used to repeat a set of instructions until a condition is met. This reduces code
2. **while loop:** Used when the condition is checked before the loop starts.
3. **do-while loop:** Executes the loop body at least once before checking the condition.
8. What are the differences between while loop and do-while loop?
**while loop:**
**do-while loop:**
- Executes the loop body at least once.
The break statement is used to exit from a loop or switch statement before it completes its normal
iteration.
**Example:**
```
if (i == 5) break;
```
The continue statement is used to skip the current iteration of a loop and continue with the next
iteration.
**Example:**
```
if (i == 5) continue;
```
11. What are the different types of header files used in C programs?
Header files contain function declarations and macro definitions for libraries. Common header files
include:
1. **stdio.h:** For input/output functions (e.g., printf, scanf).