Notes On C
Notes On C
1. **Basic Concepts:**
2. **Control Structures:**
4. **Functions:**
5. **File Handling:**
6. **Algorithms:**
- **Short-Answer Questions:**
- **Programs:**
- Writing a C program to add days to the current date and display the updated date.
- **Conceptual Questions:**
4. **Write a C program to merge two sorted arrays into a single sorted array.**
5. **Write a C program to implement a stack using arrays and provide push, pop, and
display operations.**
2. **What are the different storage classes in C? Explain each with an example.**
1. **Write a C program to read a text file and count the number of lines, words, and
characters in it.**
2. **Explain the difference between text mode and binary mode in file handling with
examples.**
4. **What are the different modes of opening a file in C? Explain each mode with an
example.**
5. **Write a C program to append data to an existing file.**
1. **Explain the working of a queue and provide a C program to implement it using arrays.**
4. **Describe the bubble sort algorithm and provide a C program to sort an array using
bubble sort.**
5. **What is a circular linked list? Write a C program to create and display a circular linked
list.**
3. **What is a doubly linked list? Write a C program to implement insertion and deletion in
a doubly linked list.**
4. **Explain the concept of function pointers and provide an example where function
pointers are useful.**
1. **Explain the compilation process in C. What are the different stages involved?**
2. **List and describe the basic data types in C. Provide examples of each.**
3. **What are the differences between `int`, `float`, and `double` data types?**
2. **Explain the syntax and use of the `switch` statement in C with an example.**
3. **Describe the use of logical operators in C. How does short-circuit evaluation work with
`&&` and `||` operators?**
2. **What is an Abstract Data Type (ADT)? Give an example of an ADT and its
applications.**
3. **Write a C program that demonstrates the use of pointers to access and modify the
value of a variable.**
### Functions:
2. **What is the difference between function declaration and function definition? Provide
examples.**
3. **Explain how arguments are passed to functions in C. What are the differences
between pass-by-value and pass-by-reference?**
1. **Write a C program to open a file in read mode, read its contents, and display them on
the screen.**
2. **Explain the differences between `fopen`, `fclose`, `fread`, and `fwrite` functions in
C. Provide examples.**
3. **Write a C program that appends text to an existing file.**
### Algorithms:
2. **Write a C program to perform binary tree traversal (in-order, pre-order, and post-
order).**
3. **Explain the concept of a stack and its applications. Write a C program to implement a
stack using arrays.**
1. **What are the benefits of using an `enum` rather than a `#define` constant in C?**
3. **Describe the difference between the `if` statement and the `switch` statement in C
with examples.**