C Programming Notes
Complete exam-focused notes covering the fundamentals of C programming — definitions, concepts, syntax and important programs for BCA Semester 1.
#include <stdio.h> int main() { printf("Hello, World!\n"); return 0; }
01. What is C Programming?
C is a general-purpose, procedural programming language developed by Dennis Ritchie at Bell Laboratories in the early 1970s.
C is a general-purpose, procedural programming language used for developing system software, application software and embedded systems.
02. Features of C
C is popular because it provides both high-level programming features and low-level memory control.
- Simple and efficient
- Structured programming language
- Portable
- Fast execution
- Rich set of operators
- Supports pointers
- Supports functions
- Extensible
03. Basic Structure of a C Program
A C program generally consists of header files, the main function, declarations, statements and a return statement.
#include <stdio.h>
int main()
{
int a = 10;
printf("%d", a);
return 0;
}Remember the basic flow: Header → main() → Declaration → Statements → return 0
04. Data Types
A data type specifies the type of data that a variable can store.
| Data Type | Purpose | Example |
|---|---|---|
| int | Integer values | 10 |
| float | Decimal values | 10.5 |
| char | Single character | 'A' |
| double | Large decimal values | 10.5678 |
05. Variables
A variable is a named memory location used to store a value that can change during program execution.
int age = 18; float marks = 85.5; char grade = 'A';
06. Operators
Operators are symbols used to perform operations on operands.
07. Control Statements
Control statements determine the order in which statements are executed.
Decision Making
- if
- if-else
- else-if
- switch
Looping Statements
- for loop
- while loop
- do-while loop
08. Functions
A function is a block of code designed to perform a specific task.
int add(int a, int b)
{
return a + b;
}09. Arrays
An array is a collection of elements of the same data type stored in contiguous memory locations.
int numbers[5] = {
10, 20, 30, 40, 50
};10. Pointers
A pointer is a variable that stores the memory address of another variable.
int a = 10; int *ptr = &a;
⚡ Last-Minute Revision
- Learn the definition of C.
- Remember the basic structure of a C program.
- Revise all basic data types.
- Learn operator categories.
- Understand if, switch and loops.
- Practice arrays and functions.
- Remember the definition of pointers.
- Practice basic C programs.