Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views2 pages

Module 5 Question Bank

The document is a question bank for a programming course focused on structures, unions, and file handling in C. It includes various questions that assess understanding of concepts such as structure declaration, file operations, and enumeration types. Each question is categorized by marks, cognitive level, and course outcomes.

Uploaded by

vishwanathhhh1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Module 5 Question Bank

The document is a question bank for a programming course focused on structures, unions, and file handling in C. It includes various questions that assess understanding of concepts such as structure declaration, file operations, and enumeration types. Each question is categorized by marks, cognitive level, and course outcomes.

Uploaded by

vishwanathhhh1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Bapuji Institute of Engineering and Technology, Davanagere

Department of Computer Science and Engineering

Principles of Programming using C [BCSESC103/203]


Module V
Structure and Union, Files

QUESTION BANK
Sl. Question Marks RBT COs
No. Level
1. Discuss the general syntax of structure variable declaration of structure 8 L3 CO4
to store book information.
2. Differentiate between structure and union. 6 L2 CO4
3. Write a program to write employees details in a file called employee.txt. 6 L3 CO4
Then read the record of the nth employee and calculate his salary.
4. Discuss the different modes of operation on files with suitable example. 8 L3 CO4
5. Differentiate between gets() and fgets(). 6 L2 CO4
6. Implement structures to read, write and compute average- marks of 6 L3 CO4
the students, list the students scoring above and below the average
marks for a class of N students.
7. What is structure? Explain the declaration of structure with an example 6 L2 CO4
8. Differentiate between structures and unions 6 L3 CO4
9. Develop a C program to read and display the information of all the 8 L3 CO4
students in the class display.
10. Define Enumerated data type. Explain the declaration and access of 6 L2 CO4
enumerated datatypes with a code in C
11. Explain the process of opening a file in C 6 L2 CO4
12. Write a C program to demonstrate fwrite() function 8 L3 CO4
13. Explain various modes in which file can be opened for processing 7 L2 CO4
14. Implement structure to read, write and compute average marks of the 8 L3 CO4
students. List the students scoring above and below the average marks
for a class of n students
15. What are enumeration variable? How are they declared 5 L1 CO4
16. Write a short note on functions used to 8 L2 CO4
Read data from a file
Write data to a file
17. Differentiate structures and unions with syntax and example 6 L3 CO4
18. How to detect END-OF-FILE 6 L2 CO4
19. Explain how to declare structure, initialize structure and access the 8 L2 CO4
structure variable with an example.
20. Explain how a structure variable is passed as a parameter to a function 6 L2 CO4
with an example.
21. Explain typedef with example. 6 L2 CO4

22. Define union. Explain how to declare union, initialize union and access 8 L3 CO4
the union variable with an example.
23. Define an enumeration. Explain how to declare enumeration, initialize 10 L3 CO4
enumeration and access the enumeration variable with an example.
24. What is file? Explain fopen(), fclose(), fscanf() and fprintf() functions. 10 L3 CO4

25. Explain the different types of files in C. 6 L2 CO4

26. Explain fputc(),fputs(), fgetc() and fgets() functions with syntax. 10 L3 CO4

27. Write a C program to copy a text file to another, read both the input file 10 L3 CO4
name and target file name.

28. Find the size in terms of bytes for the following structure: 4 L3 CO4
struct Employee
{
int emp_id;
char name[20];
double salary;
char designation[20];
float experience;
};

29. Write a C program using structures to find the largest of three numbers. 8 L3 CO4
30. Write a C program to read, display, add and subtract two complex 8 L3 CO4
numbers using structures.
31. Write a C program to enter two points and then calculate the distance 8 L3 CO4
between them using structures.
32. Explain nested structures with an example. 8 L2 CO4
33. Write a program to read and display information of a student using a 8 L3 CO4
structure within a structure.
34. Explain array of structures with an example. 8 L2 CO4
35. Write a program to read and display the information of all students 8 L3 CO4
present in the class.
36. Write a program, using a pointer to a structure to initialize the members 8 L3 CO4
of the structure.
37. Write a program using an array of pointers to a structure, to read and 8 L3 CO4
display the data of students.
38. Write a program to read, display, add and subtract two heights. Height 8 L3 CO4
should be given in feet and inches.
39. Write a program to display the name of the colours using an enumerated 8 L3 CO4
type.
40. Explain streams in C. 6 L2 CO4

You might also like