stdlib


1. Mathematical Operations:

#include <stdlib.h>
#include <stdio.h>

int main() {
  int a = 5, b = 6;
  printf("Sum: %d\n", a + b);
  printf("Difference: %d\n", a - b);
  printf("Product: %d\n", a * b);
  printf("Quotient: %d\n", a / b);
  printf("Remainder: %d\n", a % b);
  return 0;
}

2. Random Number Generation:

#include <stdlib.h>
#include <stdio.h>

int main() {
  int i;
  srand(time(NULL));  // Seed random generator
  for (i = 0; i < 10; i++) {
    printf("Random number: %d\n", rand());
  }
  return 0;
}

3. Memory Allocation and Deallocation:

4. Casting:

5. Converting Strings to Numbers:

6. Sorting an Array:

7. Searching in an Array:

8. String Manipulation:

9. File Reading:

10. File Writing:

11. Environment Variables:

12. Command Line Arguments:

13. Exit Status:

14. Error Handling:

15. Dynamic Array:

16. Linked List:

17. Binary Tree: