0% found this document useful (0 votes)
12 views

C Programming SET A

Uploaded by

Aashish Rokka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

C Programming SET A

Uploaded by

Aashish Rokka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

3. Write a C program representing the following flowchart.

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 :A

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.

Do not open this question paper until instructed.


SECTION A
Multiple Choice Questions (10x1=10) SECTION B
SHORT ANSWER QUESTION
1. Differentiate between the pre-increment and post-increment operators in C. Answer ANY FIVE Questions. (5x4=20)
2. List the difference between function call by value and function call by 1. Justify why do we need user defined data type in C with an example?
reference in C. 2. Design a flowchart for sorting the elements in an array in ascending order
3. Describe the role of the sizeof operator in C. 3. Write a program that read data from a file “input.txt” and writes to “output.txt”.
4. What is the significance of the void keyword in a function declaration? 4. What is structure? When do we use a structure? How can the members of the
5. How is a structure different from an array and union in C? structure be accessed with arrow operator (->)? Demonstrate with an example
6. What does the break statement do in a C program? 5. What do you mean by data types? What are global variables and local
7. Write the missing code so that the y pointer will point to variable x in the variables? Demonstrate it in example
following code: 6. Write a program to add two numbers using call by reference.
int x = 7, *y = __________; 7. What are the different modes available for File handling in C? Explain it
A. *x
B. &x
SECTION C
C. x
LONG ANSWER QUESTIONS
D. x* Answer ANY TWO Questions. (2x10=20)
8. How do you open and close a file in C programming?
1. Define a structure representing a student with fields such as name, roll number,
9. How many bytes of memory space is required for the following union
and marks. Create an array of structures to store information for five students.
declaration?
Write a function that takes this array and calculates the average marks.
union sample
2. Develop a C program that reads data from a text file containing integers.
{
Implement functions to find the sum and average of the numbers in the file.
int i; // assume i requires 4 bytes
Additionally, create a function to determine the maximum and minimum values
float f; // assume f requires 8 bytes
[Mandatory Question]
char c; // assume c requires 1 byte
};
A. 13 bytes
B. 14 bytes
C. 8 bytes
D. Depends on the values assigned to all the variables in the union
10. Discuss the differences between the do-while loop and the while loop in C.

You might also like