Exam-Oriented Previous Year Questions

Pointers and File Handling in C – Previous Year Questions (PYQs)

JNTUH • CBIT • VASV • VCE | IPLTS

This page offers a comprehensive collection of Previous Year Questions (PYQs) on Pointers and File Handling in C Programming collected from examinations conducted by reputed engineering colleges like JNTUH, CBIT, VASV and VCE. The questions are organized topic-wise with answers and explanations to help students prepare effectively for semester exams, practical lab viva, and competitive assessments.

POINTERS – Short & Long Answer Questions (Year-wise)

Year – 2025


  1. A pointer variable contains the ______ of another variable. (VCE–2025) 2M
  2. How do you declare a pointer to a pointer? (CBIT–2025) 2M
  3. Write a program to demonstrate the use of pointers to strings. (CBIT–2025, VCE–2025) 5M

Year – 2024


  1. What is a pointer in C? (CBIT–2023, VCE–2024) 2M
  2. Write a C program to demonstrate how pointers are handled in a program. (CBIT–2023, VCE–2024) 5M
  3. How can a pointer be used to access individual elements of an array? Explain with an example. (CBIT–2022, VCE–2024) 5M
  4. Explain the use of pointers to structures with examples. (CBIT–2022, VCE–2024) 5M
  5. Write a C program to demonstrate pointer arithmetic on an integer array. (VCE–2024) 5M

Year – 2023


  1. Explain types of pointers in brief. (JNTUH–Mar/Apr-2023) 5M
  2. Write a C function that returns a pointer to the maximum of two integers. (VASAVI–2023) 5M
FILE HANDLING & PREPROCESSOR – Short & Long Answer Questions (Year-wise)

Year – 2025


  1. Why do we need files? (VCE–2025) 2M
  2. Write a program to open, write to, and read from a text file in C. (CBIT–2025) 5M
  3. Illustrate random access file operations with examples. (CBIT–2025) 5M
  4. Write a C program to reverse the contents of a given file. (VCE–2025) 5M

Year – 2024


  1. List some file input/output functions. (CBIT–2023, VCE–2024) 2M
  2. List out the different file access modes in C. (CBIT–2023, VCE–2024) 2M
  3. How can you check if a file exists before opening it in C? (JNTUH–Jan/Feb-2024) 1M
  4. Compare #ifdef and #ifndef. (JNTUH–Jan/Feb-2024) 5M
  5. Append data to text file program. (JNTUH–Jan/Feb-2024) 5M
  6. Write a C program to create a text file and find the total number of characters and lines in it. (VCE–2024) 5M
  7. Write a program to open the file File1.txt, write text, read it again and display it on the monitor. (VASAVI–2024) 5M

Year – 2023


  1. Demonstrate fclose() function. (JNTUH–Mar/Apr-2023) 1M
  2. Write about #ifdef in brief. (JNTUH–Mar/Apr-2023) 1M
  3. How do you append data to an existing file in C? (JNTUH–Sep-2023) 1M
  4. Explain pointer for inter-function communication. (JNTUH–Mar/Apr-2023) 5M
  5. Explain text file modes. (JNTUH–Mar/Apr-2023) 5M
  6. Write a C program using feof() and ferror(). (JNTUH–Mar/Apr-2023) 5M
  7. Explain file operations in detail. (JNTUH–Mar/Apr-2023) 5M
  8. Write a C program to copy one file to another. (CBIT–2023, VCE–2024, VASAVI–2023) 5M
  9. Write a simple C program to open, read and close a file. (CBIT–2023, VCE–2024) 5M
  10. Given two files file1.txt and file2.txt, write a program to copy contents and display the output. (VASAVI–2023) 5M

Year – 2022


  1. Write the common uses of rewind() and ftell() functions. (CBIT–2022) 5M