[go: up one dir, main page]

0% found this document useful (0 votes)
18 views3 pages

C Basics Training Notes

The document provides an overview of the C programming language, including its history, features, program structure, and compilation process. It covers essential concepts such as keywords, identifiers, constants, and variables, detailing their rules and examples. C is highlighted as a simple, portable, and efficient middle-level language that has influenced many modern programming languages.

Uploaded by

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

C Basics Training Notes

The document provides an overview of the C programming language, including its history, features, program structure, and compilation process. It covers essential concepts such as keywords, identifiers, constants, and variables, detailing their rules and examples. C is highlighted as a simple, portable, and efficient middle-level language that has influenced many modern programming languages.

Uploaded by

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

Training Notes: Basics of C Language

1. History of C
Developed by Dennis Ritchie at Bell Laboratories in 1972.

Based on earlier languages like BCPL and B.

Designed to develop the UNIX operating system.

Called the 'Mother of all Programming Languages'.

Influenced modern languages like C++, Java, and Python.

ANSI C (Standard C) was introduced in 1989.

2. Features of C
Simple: Easy to learn and use.

Portable: Programs can run on different machines without modification.

Structured: Supports modular programming (use of functions).

Rich Library: Has inbuilt functions for common tasks.

Efficient: Produces fast and optimized programs.

Low-level Access: Direct memory manipulation using pointers.

Middle-level Language: Combines high-level and low-level features.

Extensible: Can add new features and functions.

3. Structure of a C Program
#include <stdio.h>

int main() {

printf("Hello, C Language!\n");

return 0;

Parts of a C program: Preprocessor directives, Global declarations, main() function, Local


declarations, Statements, User-defined functions.
4. Compilation and Execution Process
Steps:

1. Editing – Write source code (.c file).

2. Preprocessing – Handles #include and #define.

3. Compilation – Converts source code into object code.

4. Linking – Combines object code with libraries to create executable.

5. Loading – Executable is loaded into memory.

6. Execution – CPU executes the program.

Diagram: Source Code → Preprocessor → Compiler → Object Code → Linker → Executable →


Loader → Execution.

5. Keywords in C
Reserved words with predefined meaning.

Cannot be used as identifiers.

Examples: int, float, char, if, else, for, while, do, switch, case, break, return, void, static, const,
struct, typedef.

Total Keywords in C: 32.

6. Identifiers
Names given to variables, functions, arrays, etc.

Rules:

- Can contain letters, digits, and underscore (_).

- Must begin with a letter or underscore.

- Case sensitive (Age and age are different).

- Cannot be a keyword.

Examples: marks, student1, total_sum.

7. Constants
Fixed values that do not change during program execution.
Types:

1. Integer Constants – 10, -45, 0.

2. Floating-point Constants – 3.14, -0.001.

3. Character Constants – 'A', '9'.

4. String Constants – "Hello", "C Language".

5. Symbolic Constants – Defined using #define.

Example: #define PI 3.14159.

8. Variables
Named memory location to store data.

Declaration: int age;

Initialization: int age = 25;

Types: int, float, char, double.

Example:

int roll = 101;

float marks = 89.5;

char grade = 'A';

You might also like