This document contains important questions from multiple units related to files, functions, and sorting in C programming. Some of the key questions asked include writing programs to copy files, read and write data to files, perform file I/O operations, implement various sorting algorithms like selection sort, insertion sort and bubble sort, perform linear and binary searches on data, write recursive functions to calculate factorials or Fibonacci series, and pass parameters and return values to and from functions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
105 views3 pages
Mid Important Questions-Pps
This document contains important questions from multiple units related to files, functions, and sorting in C programming. Some of the key questions asked include writing programs to copy files, read and write data to files, perform file I/O operations, implement various sorting algorithms like selection sort, insertion sort and bubble sort, perform linear and binary searches on data, write recursive functions to calculate factorials or Fibonacci series, and pass parameters and return values to and from functions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
PPSIMPORTANT QUESTIONS FOR MID
UNIT-III
1. What is file? Explain various types of files.
2. Discuss about random access file functions (or) file positing functions with syntax and example. 3. Write a C program to copy contents of one file to another. 4. Write a C program to copy integer constants of binary file to another file. 5. Write a C program to count numbers of characters in text file. 6. Explain steps for file operations and different modes of files. 7. Differentiate between text file and binary file. 8. Write a C program to read a text file convert all lower case characters to uppercase. 9. Write a C program to merge two files into a third file (i.e., the contents of the first file followed by those of the second are put in the third file). 10.Explain Steps for file operations and different modes of files. 11.Write a C code to read and print the contents of a file. 12.What is file pointer? Explain steps for sequential file operations. 13.Discuss about binary file input/output functions. 14.Explain various modes of text file. 15.Write a C program to append the data to existing file. 16.Explain various modes of binary file. 17.Write a C program to count number of characters, words, lines in text file. 18.Write a C program using structures to print students examination marks, name and roll no. in a file using fread() & fwrite() functions. 19.Demonstrate the following functions with correct syntax and code: a)fopen() b)fread() c) fwrite() d)fclose() 20.Explain the following functions with syntax and example: a)fprintf() b)fscanf() c)fgets() d)fputs() e)fputc f)fgetc()
UNIT-IV
1. Define function? Generate categories of functions.
2. Discuss various methods of passing parameters to functions with suitable C code. 3. What is recursion? Write a C program to find factorial of a number using recursion. 4. What are advantages of function? Explain function definition, function header, function body and function declaration with an example. 5. List and explain the limitations of recursive functions. 6. Explain function prototype with an example. 7. What are user defined functions? Write a C program to perform addition, subtraction, multiplication and division using functions. 8. Write a C program using recursive for binary to decimal conversion. 9. Explain how pointers are used as function arguments. 10. Write a C program to find Fibonacci series using recursion 11. Explain about dynamic memory allocation. 12. Write a C program to find GCD of two numbers using recursion. 13. Write a C program using recursive function to reverse number. 14. Write a C program using function to check whether the given number is prime or not. 15. Write a C program to find sum of n numbers using Recursive function. 16. Write a C program to find xn using recursion. 17. Write a C program that uses calloc() to create memory block for storing n integers and print the stored contents 18. Write a C program using functions to swap two numbers. 19. Illustrate the concept of passing arrays to functions with relevant example program. 20. How to pass the structure to functions as an argument? Explain with suitable example.
UNIT-V
1. What do you mean by sorting? Mention the different types of sorting
with examples 2. Explain how linear search works and mention its pros and cons. 3. Discuss about bubble sort with an example. 4. Explain binary search with C code. 5. What is time complexity? Discuss the time complexity of linear and binary search 6. Write an algorithm and develop a C program that reads N integer numbers and arrange them in ascending order using selection sort. 7. Discuss the insertion sort with an example. 8. Compare insertion sort and selection sort. 9. Explain and apply selection sort on {23,9,67,89,56,19,12}. 10.Explain and apply binary search for following elements 2,8,12,23,34,45,56,67,78,89,90,100 where search element is 2.