bca-2-sem-advanced-programming-in-c-2002-p16-apr-2018
bca-2-sem-advanced-programming-in-c-2002-p16-apr-2018
bca-2-sem-advanced-programming-in-c-2002-p16-apr-2018
com
1) NULL 2) \0
3) . 4) /0
printf ( % C , * str) ;
1) Bye 2) B
3) y 4) Error
1) # 2) ##
3) / 4) \
P.T.O.
http://www.sppuonline.com
http://www.sppuonline.com
iv) Which of the following is appropriate for reading multi - word string?
1) printf ( ) 2) scanf ( )
3) gets ( ) 4) puts ( )
v) Data written into a file using fwrite ( )
Can be read back using
1) fscanf ( ) 2) fread ( )
3) fgets ( ) 4) All of the above
vi) If variable is a pointer to a structure, then which of the following
operator is used to access data members of the structure.
1) & 2) .
3) * 4) →
vii) Which of the following is compiler control directive?
1) # ifdef 2) # define
3) # include 4) All of the above
b) Answer the following: [7]
i) What is # pragma directive?
ii) What is purpose of strtok ( ) Function?
iii) Define pointer to pointer.
iv) How is a union declared?
v) Give syntax of fseek ( ) function.
vi) Find memory required for the following:
struct demo
{
int x ;
char y [15] ;
}d;
[Note - Assume int takes 4 bytes]
[5319] - 2002 2
http://www.sppuonline.com
http://www.sppuonline.com
Group - I
Q2) Attempt the following:
a) What do you mean by Array of pointers and pointer to array? Explain
with an example. [5]
b) Write a C program that accepts n words and display the longest word.[5]
d) List any three string handling function with their usage. [3]
[5319] - 2002 3
http://www.sppuonline.com
http://www.sppuonline.com
Group - II
Q5) Attempt the following:
a) Write a C program to accept and display book details of n books as
book-title, author, publisher and cost. [5]
b) Write user defined functions to copy one string into another string and
reverse the string without using standard library functions. [5]
c) Define Dynamic memory Allocation. What are the advantages of dynamic
memory allocation over static allocation? [4]
Q6) Attempt the following:
a) Explain fseek ( ) function in detail. [4]
b) Compare Macro and Function. [4]
c) Trace the output and Justify. [3]
struct student
{
int roll ;
char name [10];
} S1, * P, S[5];
printf (% d % d % d, sizeof (S1), sizeof (P), sizeof (S));
d) Define union. Explain how to access its member. Give example.[3]
Q7) Attempt the following:
a) Explain pointer to structure concept with example. [4]
b) Discuss file opening modes in detail. [4]
c) Explain any three predefined macros. [3]
d) Explain the purpose of each of the following. [3]
declarations
i) int *P [5]
ii) int f1 (int *P [ ])
iii) int * f2 (int *P [])
² ² ²
[5319] - 2002 4
http://www.sppuonline.com