0% found this document useful (0 votes)
2 views5 pages

C Language Notes

The document provides an overview of algorithms and flowcharts, including definitions, examples, and symbols used in flowcharts. It also covers the history, importance, and basic elements of the C programming language, including data types, variables, constants, and storage classes. Additionally, it presents algorithms and flowcharts for basic operations like addition and simple interest.

Uploaded by

rathodashwini325
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

C Language Notes

The document provides an overview of algorithms and flowcharts, including definitions, examples, and symbols used in flowcharts. It also covers the history, importance, and basic elements of the C programming language, including data types, variables, constants, and storage classes. Additionally, it presents algorithms and flowcharts for basic operations like addition and simple interest.

Uploaded by

rathodashwini325
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Algorithm:

An algorithm is a step-by-step procedure to solve a problem.

Example: To add two numbers:

1. Start

2. Input two numbers

3. Add them

4. Show result

5. End

2. Flowchart:

A flowchart is a diagram that shows steps of a process using symbols.

Example: A flowchart to add two numbers has Start, Input, Process, Output, and End symbols.

3. Flowchart Symbols:

- Terminator: Start/End (Oval)

- Process: Task or Operation (Rectangle)

- Input/Output: Data Input or Output (Parallelogram)

- Decision: Yes/No or True/False (Diamond)

- Arrow: Flow of steps

4. History of C:

C was developed by Dennis Ritchie in 1972 at Bell Labs. It was made to write the UNIX OS.

5. Importance of C:

- Fast and powerful

- Used in system and embedded programming


- Portable and easy to learn

6. C Character Set:

Includes letters (A-Z, a-z), digits (0-9), symbols (+, -, *, etc.), and special characters.

7. C Tokens:

Smallest units in a C program: Keywords, Identifiers, Constants, Strings, Operators, etc.

8. C Keywords:

Reserved words with special meaning. Example: int, return, if, else, for.

9. Identifier:

Name given to variables, functions, etc.

Rules:

- Can't start with digit

- Only letters, digits, underscore

- No keywords

10. Constant:

Fixed value. Types: Integer, Float, Character, String

11. Variable:

Named memory location. Declared as:

int a; float b; char c;

12. Data Types in C:


- int: integers

- float: decimal numbers

- char: characters

13. Storage Classes:

- auto: default

- extern: external linkage

- static: retains value

- register: fast access

14. Assign Values:

int a = 10;

15. Symbolic Constants:

Constants defined using #define.

Example: #define PI 3.14

16. Variable as Constant/Volatile:

- const int x = 10; // constant

- volatile int y; // value may change anytime

17. Escape Sequences:

- \n: new line

- \t: tab

- \": double quote


18. Structure of C Program:

- Header files

- main() function

- Variable declarations

- Statements

19. Format Specifiers:

- %d: int

- %f: float

- %c: char

- %s: string

20. Algorithm for Addition:

1. Start

2. Input A, B

3. Sum = A + B

4. Print Sum

5. End

21. Flowchart for Multiplication:

(Include basic input, process, and output symbols)

22. Algorithm + Flowchart for Simple Interest:

Algorithm:

1. Start

2. Input P, R, T
3. SI = (P * R * T) / 100

4. Print SI

5. End

(Flowchart includes input/output/process symbols)

You might also like