Unit - I: Basics of C Programming
Overview and Key Concepts
1.1 Algorithms and Flowcharts
• 1.1.1 Steps for Writing Algorithm:
• - Define the problem
• - Outline the input and output
• - Develop the logic step-by-step
• - Write pseudocode
• - Verify with test cases
• 1.1.2 Notations of Flow Charts:
• - Oval: Start/End
1.2 Structure of C Program
• - Header Files: #include <stdio.h>
• - main() Function: Entry point of program
• - Declarations: Variables and constants
• - Statements: Logic implementation
• - Return Statement
• Assembler, Linker, Compiler, Interpreter:
• - Assembler: Converts assembly to machine
code
1.3 Character Set, Keywords, and
Identifiers
• - Character Set: Letters, digits, symbols
• - Keywords: Reserved words (e.g., int, return)
• - Identifiers: User-defined names
• - Constants: Fixed values (e.g., 10, 'a')
• - Variables: Storage for data
1.4 Data Types
• 1.4.1 Predefined Data Types:
• - Integer: int, unsigned, signed, long
• - Float: float, double
• - Character: char
• - Special: Octal, hexadecimal
• 1.4.2 User-Defined Data Types:
• - Arrays: Collection of elements
• - Structures: Custom data structures
1.5 Operators and Expressions
• 1.5.1 Formatted Input/Output:
• - printf(), scanf()
• 1.5.2 Types of Operators:
• - Arithmetic: +, -, *, /
• - Logical: &&, ||, !
• - Relational: ==, !=, >, <
• - Increment/Decrement: ++, --
• - Bitwise: &, |, ^