Computer Science NOTES for programming in C
Computer Science NOTES for programming in C
Flowcharts
● Flowcharts are visual representations of algorithms.
● They use arrows and symbols like circles, ovals, and rectangles.
Pseudocode
● Pseudocode is a compact, informal description of an algorithm, omitting details that aren't
essential.
● It focuses on human readability and is used for planning, documenting algorithms, and
outlining program structure before coding.
● There are no strict rules for writing pseudocode, as it is not an executable program.
● Flowcharts can serve as graphical alternatives to pseudocode but may require more space.
Data Types in C
Basic Data Types
C language supports a few basic data types.
● The char data type is one byte and stores a single character. C does not have a built-in
string type because text is made up of characters.
If Else Statement
The if else statement is a fundamental control structure that allows you to execute different
blocks of code based on whether a condition is true or false.
While Loop
A while loop repeatedly executes a block of code as long as a specified condition is true.
The condition is checked before each execution of the loop body.
Do While Loop
A do while loop is similar to a while loop, but it guarantees that the block of code is
executed at least once. The condition is checked after each execution of the loop body.
For Loop
A for loop is a control structure for executing a block of code a specific number of times. It
consists of three parts: initialization, condition, and increment/decrement.
Nested Loop
A nested loop is a loop placed inside another loop. The inner loop will execute completely
for each iteration of the outer loop.