Revision Notes: Programming for Problem Solving (C Programming)
1. Types of Loops & Fibonacci using while loop
Loops: for, while, do-while
Example:
while(i <= n) { ... }
Program prints Fibonacci using while loop.
2. Structure vs Union & Student Record Program
Structure: allocates memory for all members.
Union: shares memory among members.
Program stores student data using structure.
3. Recursion & Factorial Program
Recursion: function calling itself.
Example: factorial(n) = n * factorial(n-1).
4. Storage Classes
Types: auto, extern, static, register
Defines variable scope, lifetime, and storage.
Page 1
Revision Notes: Programming for Problem Solving (C Programming)
5. File Handling
Uses fopen, fclose, fprintf, fscanf.
Example: Program reads and writes to a file.
6. Menu-Driven Arithmetic Operations
Uses switch-case and functions to perform +, -, *, /.
7. Pointer Arithmetic & Dynamic Memory
Pointer arithmetic: ++, --, +, - operations.
Dynamic memory: malloc, calloc, realloc, free.
8. Arrays & Bubble Sort
Array: collection of similar data.
Bubble sort: compares and swaps adjacent elements.
9. Arrays & Strings: Vowel Count
String: array of characters.
Program counts vowels in input string.
10. Types of Functions & Prime Check
User-defined: void, return types, parameters.
Page 2
Revision Notes: Programming for Problem Solving (C Programming)
Checks if number is prime using function.
11. Matrix Addition & Multiplication
Matrix represented using 2D arrays.
Program performs addition and multiplication.
12. Dynamic Memory Functions
malloc: allocates memory
calloc: allocates and initializes
realloc: resizes
free: deallocates
13. Nested Structures & Employee Data
Structure inside another structure.
Program displays employee details.
14. Command Line Arguments
Main function: int main(int argc, char *argv[])
Takes input from command line.
15. Algorithm and Flowchart
Page 3
Revision Notes: Programming for Problem Solving (C Programming)
Algorithm: step-by-step logic.
Flowchart: graphical representation.
Example: factorial calculation.
8 Mark Q1. Call by Value vs Reference
Value: copy passed
Reference: address passed
Example: swap using pointers.
Q2. if, if-else, switch Statements
Control statements for decision making.
Syntax with examples.
Q3. Reverse String without Library
Loop from end to start to print string.
Q4. Local vs Global Variables
Local: inside function
Global: outside all functions
Q5. Largest and Smallest in Array
Loop through array and compare elements.
Page 4
Revision Notes: Programming for Problem Solving (C Programming)
Q6. Swap Using Pointers
Use of * and address-of operator (&)
Q7. break and continue
break: exits loop
continue: skips iteration
Q8. Function & Parameter Passing
Pass by value and reference illustrated.
Q9. gets() vs scanf()
gets: reads full line
scanf: reads till space
Q10. Actual vs Formal Parameters
Actual: in main()
Formal: in function definition
Q11. Palindrome Number
Reverse number and compare with original.
Q12. Recursion: Fibonacci
Base case and recursive calls.
Page 5
Revision Notes: Programming for Problem Solving (C Programming)
Q13. Sum and Average of Array
Loop to calculate total and average.
Q14. Header Files
#include directive
Common headers: stdio.h, stdlib.h
Q15. typedef and enum
typedef: alias for data type
enum: defines set of named constants
Page 6