16902
16902
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
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