Hours) : - (L) L. (I) ) Array. 2. It. Example. 3. Examples. Numbcrs. 4. Class. (I) Recursion
Hours) : - (L) L. (I) ) Array. 2. It. Example. 3. Examples. Numbcrs. 4. Class. (I) Recursion
(i) strlvir( )
(ii) strcmp( )
(iii) strrev( ) 6
(b) Explain wilh example how strings can be handled using char array. 6
oR.
2. (a) write a program to read two st ngs from user. Calculah the length of two strings using
strlen( ) and concatenate them using sEcat( ). Also calculate the length ofthe concatenat€d
string and display it. 6
O) Explain how strings can be manipulated using arrays of pointers with suitable
example. 6
3. (a) Explain the concept of Local and Global variables with suitable examples. 6
(b) Explain function protot)le, function dehnition and function calling by using an example
of firnction that adds two numbcrs. 6
OR
4. (a) What arc different slorage classes in C ? Write features of each class. 6
(b) Explain the following :
vox-35849 (Contd.)
s. (a) Explain how structures are defined using suitable example. How can we calculate
memory size of structurc ? How are structure members acccsscd ? 6
(b) Define union. State its declaration syntax and explain how its members are accessed
using suitable example. 6
OR
6. (a) Compare union with structures using suitablc exarnple. 6
(b) What is array of structures ? Explain using a program which receives data for 3 books
and pdnts it on screen. Use the following dala :
(i) fscan( )
(ii) fsetc( )
(iii) flwite( ) 6
OR
8. (a) Write a progEm to enter following data in a file :
Computer Science
Dennis Ritchie
1986
59.7 6
(l) setw( )
(ii) putw( )
(iii) fputs( ) 6
vox 35849 2 (Contd.)
9. (a) Explain how memory can be allocated using malloc( ) in C with suitablc
example, 6
(b) Explain line function in C. Write a graphics program to draw a triangle on screen using
lire function thee times. 6
OR
10. (a) Explain dynamic memory allocation with the help of suitable example. 6
(i) fseek( )
(ii) ftell( )
(iii) frewind( ) 6