C Programming: Expanded Question Bank
1. Basics of C
1 Who developed the C programming language and in which year?
2 Compare C with earlier languages like B and BCPL.
3 What are the main advantages of structured programming over unstructured programming?
4 Describe different file types in C programming with examples of when each is used.
5 What are the key features that make C a middle-level language?
6 Why is C considered both powerful and efficient?
2. C Language Components
1 What are tokens in C? List all types with examples.
2 Explain identifiers and naming rules in C.
3 Differentiate between variable declaration and definition.
4 What is a constant in C? How do you define symbolic and literal constants?
5 List the keywords in C. Can a keyword be used as a variable name? Why or why not?
6 Explain the use of escape sequences in character constants with examples.
3. Data Types and Operators
1 List all data types in C with their sizes and format specifiers.
2 What is the difference between signed and unsigned types?
3 Explain each arithmetic operator with a suitable code snippet.
4 What are logical operators and how are they used in decision making?
5 How do relational operators differ from logical operators?
6 Explain increment and decrement operators with pre and post examples.
7 What is the ternary operator and how is it useful?
8 Give examples of bitwise operations in C.
9 Explain special operators like sizeof and comma operator.
10 What is operator precedence and how does associativity affect evaluation?
11 Describe implicit and explicit type conversions with examples.
4. Input and Output
1 Differentiate between formatted and unformatted input/output functions.
2 How are scanf and printf functions used for different data types?
3 Explain the purpose and usage of format specifiers.
4 What are the common errors to avoid while using scanf?
5. Decision Making and Branching
1 Write a program using if-else to check if a number is positive, negative, or zero.
2 How does the else-if ladder simplify multiple conditions?
3 Give an example of a nested if-else structure and explain its flow.
4 Write a switch-case program for a simple calculator.
5 What happens if break is not used in a switch case?
6 What are the limitations of switch case statements?
7 How does a goto statement affect code readability and maintainability? Give examples.
6. Loops and Iteration
1 Explain the syntax and use-case of while, do-while, and for loops.
2 Give a comparative chart of entry-controlled and exit-controlled loops.
3 Write a program using nested loops to print a pattern.
4 What is the use of break and continue in loops? Provide examples.
5 Can loops be infinite? Give an example and explain how to stop them.
7. Arrays and Strings
1 What is an array and how is it different from individual variables?
2 How do you declare and initialize one-dimensional arrays?
3 Explain how two-dimensional arrays are stored and accessed in memory.
4 Give an idea about multidimensional arrays and their real-world applications.
5 How are strings stored in memory in C?
6 Write a program to reverse a string without using library functions.
7 Demonstrate the use of strlen, strcpy, strcat, and strcmp with examples.
8 Write a program to extract a substring from a given string.
9 Explain how to replace characters in a string using a loop.
10 How can two strings be concatenated without using strcat()?
8. Functions and Storage Classes
1 What are the benefits of using functions in C programs?
2 Differentiate between user-defined and library functions.
3 What is a function prototype and why is it important?
4 Explain the difference between actual and formal parameters.
5 Describe call by value and call by reference with code.
6 What are storage classes in C? Explain Auto, Extern, Static, and Register.
7 How do scope and lifetime of variables affect program behavior?
8 Write a recursive function to calculate factorial of a number.
9 When would you choose a recursive solution over an iterative one?
10 What is tail recursion? Give an example.
11 Compare function overloading and function overriding (if applicable to C).