0% found this document useful (0 votes)
9 views4 pages

16902

This document is an examination question paper for the B.E. / B.Tech. degree in Computer Programming, covering various topics in C programming. It includes multiple-choice questions, short answer questions, and programming tasks related to data types, control structures, storage classes, and file management. The exam is structured into two parts, with a total duration of 3 hours and a maximum score of 100 marks.
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)
9 views4 pages

16902

This document is an examination question paper for the B.E. / B.Tech. degree in Computer Programming, covering various topics in C programming. It includes multiple-choice questions, short answer questions, and programming tasks related to data types, control structures, storage classes, and file management. The exam is structured into two parts, with a total duration of 3 hours and a maximum score of 100 marks.
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/ 4

Reg. No.

Question Paper Code : 16902

B.E. / B.TECH. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2020


First Semester
Common to all UG Programmes
19GE101 – COMPUTER PROGRAMMING
(Regulations: Mepco – R2019)
Duration: 3 Hours Max. : 100 Marks
Answer ALL Questions
PART A – (10  2 = 20 Marks)
BTL, CO

A,CO1 1. Consider the following variable declarations and definitions in C


i) int var_9 = 1;
ii) int 9_var = 2;
iii) int _ = 3;
Choose the correct statement with respect to above variables. Justify your
answer.
A) Both i) and iii) are valid B) Only i) is valid
C) Both i) and ii) are valid D) All are valid
U,CO1 2. State the use of qualifiers. Give example.
A,CO2 3. For a given integer, which of the following operators can be used to “set” and
“reset” a particular bit respectively? Justify your answer.
A) | and & B) && and || C) & and | D) || and &&
U,CO2 4. What are static variables? Specify its scope.
U,CO3 5. What is the purpose of null character in C?
A,CO3 6. Identify the valid and invalid declarations among the following statements:
Justify your answer.
int abc[2][2] = {1, 2, 3 ,4 }
int abc[][2] = {1, 2, 3 ,4 }
int abc[][] = {1, 2, 3 ,4 }
int abc[2][] = {1, 2, 3 ,4 }
U,CO4 7. What are preprocessor directives? State the advantage of using preprocessor
directives.

1 16902
A,CO4 8. Assume int is 4 bytes, char is 1 byte and float is 4 bytes. Also, assume that
pointer size is 4 bytes (i.e. typical case).
char *pChar;
int *pInt;
float *pFloat;
sizeof(pChar);
sizeof(pInt);
sizeof(pFloat);
What’s the size returned for each of sizeof() operator?
A) 4 4 4 B) 1 4 4 C) 1 4 8 D) 1 8 8

U,CO5 9. What is the use of a void pointer?


A,CO5 10. Consider the following C declaration:
struct {
short s[5];
union {
float y;
long z;
}u;
} t;
Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and
8 bytes, respectively. The memory requirement for variable t, ignoring alignment
considerations, is ________. Justify your answer.
A) 22 bytes B) 14 bytes C) 18 bytes D) 10 bytes

PART B – (5  16 = 80 Marks)
U,CO1 11. a) i. Describe the structure of a C program, its compilation and linking
process.
(8 Marks)
A,CO1 11. a) ii. Write an algorithm and draw flow chart for finding the largest of
three numbers.
(8 Marks)
O OR
r
U,CO1 11. b) i. Write short note on the following:
 typedef
 Enumeration
 pre-processor directives (#define, #include) (8 Marks)

2 16902
A,CO1 11. b) ii. Write a C program to check if the given number is prime or not. (8 Marks)

U,CO2 12. a) i. Write the difference between while and do-while loop with
suitable examples. (8 Marks)
A,CO2 12. a) ii. Write a C program to find the number of vowels in a given string
input. (8 Marks)
OR
U,CO2 12. b) i. Describe briefly about storage classes. (8 Marks)
A,CO2 12. b) ii. What is recursive function? Write a recursive function to find the
factorial of a given number. (8 Marks)

A,CO3 13. a) i. Write a C program to get a list of numbers and find the positions
of the given number in the list. (8 Marks)
U,CO3 13. a) ii. Write short notes on declaring and initializing two-dimensional
and three-dimensional arrays with suitable examples. (8 Marks)
OR
A,CO3 13. b) i. Write a C program to sort the list of names in alphabetical order. (8 Marks)
U,CO3 13. b) ii. Explain the following string library functions with suitable
examples:
 strcat()
 strcmp() (8 Marks)

A,CO4 14. a) i. Write the C program to create a function that takes pointer to an
array of integers as parameter and returns the largest value in the
array. (10 Marks)
U,CO4 14. a) ii. Demonstrate the advantages of passing address as function
parameters using suitable example. (6 Marks)
OR
A,CO4 14. b) i. Create two functions called as Max() and Min() that finds the
maximum and minimum of two values respectively. Invoke these
two functions using function pointers. (10 Marks)
U,CO4 14. b) ii. Explain the difference between pointer to an array and array of
pointers with suitable example. (6 Marks)

3 16902
A,CO5 15. a) i. Write a C program to create a structure called Book that includes
Bookid, Title, Edition, Publisher, Authors as members. Store
details of books and define a search function that searches whether
a book is available in library or not based on Bookid. (10 Marks)
U,CO5 15. a) ii. Explain about structure within a structure with suitable example. (6 Marks)
OR
A,CO5 15. b) i. Write a C program to store the content in a text file and count the
number of vowels in the text file. (10 Marks)
U,CO5 15. b) ii. Describe any four file management functions with respect to
binary and text files. (6 Marks)

4 16902

You might also like