Library Functions in C:
Library functions are predefined functions provided by the C standard library that perform common tasks such as input/output operations, string handling, mathematical calculations, memory management, etc.
- These functions save programmers from writing common functionalities from scratch.
Examples of Common Library Functions:

Example Using Library Functions:
#include <stdio.h>
#include <string.h>
#include <math.h>
int main() {
char str1[20] = "Hello";
char str2[20] = "World";
// Using string library function strcat to concatenate strings
strcat(str1, " ");
strcat(str1, str2);
printf("Concatenated string: %s\n", str1);
// Using math library function pow to calculate power
double result = pow(2.0, 3.0);
printf("2 raised to power 3 is %.0f\n", result);
return 0;
}Preprocessor Directives in C:
Preprocessor directives are instructions for the C preprocessor, which runs before the actual compilation of the program.
- They are used to include files, define macros, conditionally compile code, and more.
- Preprocessor directives always start with the
#symbol and do not end with a semicolon.
Common Preprocessor Directives:

Example Using Preprocessor Directives:
#include <stdio.h>
#define PI 3.14159
int main() {
float radius = 5.0;
float area = PI * radius * radius;
printf("Area of circle: %.2f\n", area);
return 0;
}