Programming Techniques - C Lecture Notes

The C language is a versatile, general-purpose language known for its structured and disciplined approach to computer program design.

Key points:

  • C is used across various domains, including operating systems and system programming.

  • A C program consists of functions, declarations, definitions, and statements.

    • Global variables are accessible throughout the code, while local variables are limited to the function they are defined in.

  • Comments are used to document programs and are ignored by the C compiler.

  • Preprocessor directives, such as #include, are processed before compilation.

  • Every C program must contain the main() function, where execution begins.

  • printf() is used for output, and scanf() is used for input.

  • Variables are named memory locations and must be defined with a name and data type before


The C language is a versatile, general-purpose language known for its structured and disciplined approach to computer program design.

Key points:

  • C is used across various domains, including operating systems and system programming.

  • A C program consists of functions, declarations, definitions, and statements.

    • Global variables are accessible throughout the code, while local variables are limited to the function they are defined in.

  • Comments are used to document programs and are ignored by the C compiler.

  • Preprocessor directives, such as #include, are processed before compilation.

  • Every C program must contain the main() function, where execution begins.

  • printf() is used for output, and scanf() is used for input.

  • Variables are named memory locations and must be defined with a name and data type before