Unit 4 & 5 C Programming Question Bank PDF

Summary

This document is a question bank for a C programming course focusing on Unit 4 and 5, covering topics like structures, unions, dynamic memory allocation, and file handling. Numerous practice questions are included.

Full Transcript

**QUESTION BANK** **UNIT 4 & 5** 1. What are structure in C? How to define, declare and initialize the structures? 2. How Union differs from structures? Explain with suitable example. 3. Explain the role of enumerated data type in C? 4. Explain the role of pointer to structure in C with...

**QUESTION BANK** **UNIT 4 & 5** 1. What are structure in C? How to define, declare and initialize the structures? 2. How Union differs from structures? Explain with suitable example. 3. Explain the role of enumerated data type in C? 4. Explain the role of pointer to structure in C with suitable example. 5. What is type def data type, also state its use? 6. How to create an array of structure. Explain with example. 7. Compare and contrast Structure and Union in C. 8. **What do you meant by meant by dynamic memory allocation? How it differs from Static memory allocation?** 9. **What are different function used in Dynamic memory allocation?** 10. **Explain the role of functions used for DMA with the help of suitable examples.** 11. **Explain the use of pointers in data structures.** 12. **Explain different modes of files in C** 13. **What do you meant by files? What are the advantages of file handling in C?** 14. **Explain different operation performed on files in C(open, read, write and close) with suitable example only.** 15. What are file pointers in C? Explain their significance. 16. How dynamic memory is created and destroyed? 17. Create a structure called \"Student\" with members name, age, and total marks. Write a C program to input data for two students, display their information, and find the average of total marks. 18. Create a structure named Book to store book details like title, author, and price. Write a C program to input details for array of 'n' no. of books. Find the most expensive and the lowest priced books, and display their information 19. Define a structure named \"Date\" with members day, month, and year. Write a C program to input two dates and find the difference in days between them. 20. What is file system? How files are handled in C language?

Use Quizgecko on...
Browser
Browser