C Programming SET D Final
C Programming SET D Final
1. A record contains name of football players, his age and number of matches that he
has played and the average goals he has scored in each match. Create an array of
structures to hold records of 10 such football players and write a program to read
these records and arrange them in ascending order by average goals.
2. Write a menu driven program that depicts the working of a library. The menu
option should be
a. Add book information.
b. Display book information by ascending order by book name.
c. List the count of book in the library.
d. List the information about the book whose id is given by the user.
e. Exit
Create a structure called library to hold book id, title of the book, author name and
price of the book [Mandatory Question]
3. Write a program to read a structure “book” having title, price and published date.
Date is another structure having year, month and day as its members. Enter 10
book records from the user and write in a file “record.txt”.
PRE-TEST EXAMINATION PAPER
Program : BSc.IT
Course : Introduction C Programming
Course Code : CT018-3-1
Year/ Semester : I Year / I Semester
Intake : September,2023
Date : 9th February 2024
Time Duration : 1.5 Hours
Set :D
Instruction to candidates
1. This question paper has Three (3) Sections.
2. Answer ALL questions in Section A, Very Short Answer Questions.
3. Answer Five out of Seven questions in Section B, Short Answers Questions.
4. Answer Two out of Three question in Section C, Long Answers Questions.
5. No scripts or answer sheets are to be taken out of the Examination Hall.
6. Mobile phones are strictly prohibited in the Examination Hall.
a) double fuc();
int main() { }
double func() { }
b) double func() { };
int main() { }
c) int main()
{
double func();
}
double func() { //statements}
d) None of the mentioned
6. In c programming, sizeof() function returns:
a) The length of an array in integer c) The array values one by one
b) The bytes size required to allocate in memory d) None of the above
7. In C, what is the value of a pointer variable if it hasn’t been assigned any
address?
a) 0 c) undefined
b) Null d) 1
8. Structure is a collection of:
a) Similar data types c) Values
b) Different data types d) None of the above
9. Select a function which is used to read a single character from a file at a time?
a. fputc( ) c. fputs( )
b. fscanf( ) d. fgetc( )
SECTION B
SHORT ANSWER QUESTION
Answer ANY FIVE Questions. (5x4=20)