Professional Documents
Culture Documents
Chapter - 2
Storage classes of variables, Functions
1. Write a program to calculate sum of digits in a given number using function with argument as well as
return value.
2. Write a program to check whether the given number is even or odd using function.
3. Explain recursive function with suitable example.
4. Define the term:
a. Function prototype
b. Function call
c. Function definition
d. Actual parameter
e. Formal parameter
f. Function Recursion
5. Explain call by value method of parameter transmission with example.
6. Explain call by reference method of parameter transmission.
7. What is function? Explain different types of function.
8. What is library function? Illustrate with example.
9. What is user defined function? Illustrate with example.
10. Explain following storage classes of variables.
i. Static
ii. Register
11. Explain following storage classes of variables.
i. Extern
ii. Auto
12. Write a program to find factorial of a given number using function with argument and no return value.
13. Write a program to swap two numbers using function call by reference.
Chapter - 3
Pointers, Dynamic memory allocation in ‘C’, Pointer to function
1. What is pointer? Illustrate the use of pointer variable by giving suitable example.
2. Describe pointer arithmetic with example.
3. Explain pointer to array with suitable example program.
4. Explain how the strings are accessed using pointer.
5. Write a program to demonstrate function call by reference.
6. Elaborate pointer to pointer. Write a program to describe pointer to pointer.
7. Explain different memory allocation schemes available in ‘C’
8. What is dynamic memory allocation? Explain need and advantages of dynamic memory allocation
9. Give difference between static and dynamic memory allocation. Explain with example.
10. Give dfference between malloc() and calloc() function
11. What is dynamic memory? Explain following with syntax and example.
a. malloc()
b. calloc()
c. realloc()
d. free()
12. Write a C program to swap three numbers in a cyclic order using function with call by reference.
Chapter - 4
Structure and Union
1. Define Structure with example. Give application of structure.
2. Define structure. Describe memory representation of structure with diagram.
3. Define union. Describe memory representation of union with diagram.
4. Explain declaration and initialization of structure with example.
5. Describe with example - how structure members are initialized and accessed.
6. How structure is passed to function Explain with example.
7. Explain pointer to structure with an example.
8. Define union and explain with an example how it is stored inside memory.
9. Differentiate between union and structure.
10. Describe use of typedef with suitable example.
11. Write a program to demonstrate nesting of structures.
12. Write a program to demonstrate passing structure to function.
13. Write a program to pass and return structure to function.
14. Write a program to demonstrate pointer to structure.
15. What is union of structure ? Demonstrate with example
16. Write a program to demonstrate array of structure.
17. Write a program to accept and print the student details (id, name, age, per). Create record for 10
students.
18. Explain declaration and initialization of structure with example.
19. What is enumerated data type ? How to define it in C.
20. Explain storage allocation & size of structure with example.
21. Write a program how structure variable is returned from function ?
Chapter - 5
Files and command line Arguments
Chapter - 6
1. Explain the meaning of following terms – Raster scan, Cathode Ray Tube, Interlaced raster scan,
Pixel, Resolution.
2. What is scanning? Explain Interlaced raster scan.
3. What is video card? Give the types of video cards with their text mode and graphics mode
resolutions.
4. How to initialize graphics mode? Explain with suitable example program.
5. Explain the use of following functions with their syntax with meaning of each parameter (if any). –
i) initgraph() ii) closegraph() iii) cleardevice() iv) line() v) lineto() vi) arc() vii) pieslice() viii) circle
ix) circle() x) ellipse() xi) drawpoly() xii) fillpoly() xiii) getmaxx() xiv) getmaxy() xv) setbkcolor()
xvi) setcolor() xvii) setfillstyle()
xviii) floodfill() xix) outtext() xx) outtextxy() xxi) bar() xxii) bar3d(), xxiii)Settextstyle()
6. How to draw a polygon? Explain with example program.
7. Give the library functions required to carry out following operations, along with their syntax. Also
give meaning of the parameters (if any).
1. To switch from text mode to graphics mode
2. To switch from graphics mode to text mode
3. To draw a polygon.
4. To draw and fill a polygon.
5. To display a text string at a particular co-ordinate on screen in graphics mode
6. To draw a horizontal ellipse.
7. To draw a vertical ellipse.
8. To draw a pie slice.
9. To draw a 2D bar
10. To draw a 3D bar
11. To fill color in a bound part of image.
12. To get maximum x – co-ordinates available in graphics mode.
13. To get maximum y – co-ordinates available in graphics mode.
14. To change background color in graphics mode.
15. To change foreground color in graphics mode.
16. To display a window in text mode.
17. To change text color in text mode.
18. To change text background color in text mode.
19. To display a blinking string in text mode.
20. To move cursor to a particular x and y co-ordinate position in text mode.
21. To clear the screen in graphics mode.
22. To change text font and size in graphics mode.
23. To change text color and text background color in text mode.
24. To display text in vertical direction (Bottom to Top) in graphics mode.
8. Explain the use of following text mode functions with their syntax and use of each parameter –
i) window() ii) gotoxy() iii) textcolor() iv) textbackground() v) cprintf() vi) cputs()
9. Explain the textattr() function along with the syntax and use of each parameter. Also write a
program to demonstrate use of textattr().
10. How to display a bound window in text mode? Write a program to demonstrate.
11. Write a program to display 5 concentric circles in the center of the screen. Every circle has to be
drawn in different color.
12. Write a program to display an octal shape on screen.
13. Write a program to display a pentagon on screen. Use drawpoly() function.
14. Write a program display a hexagon on screen. Use drawpoly() function.
15. Write a program to draw a parallelogram on screen and fill it with blue color. Use fillpoly()
function.
16. Write a program to display a star filled with light hatch pattern and green color.
17. Write a program to change the background color in graphics mode when a key is pressed.
18. Write a program to display a 2D bar chart. Assume suitable data.
19. Write a program to display a circle filled with blue color inside a rectangle filled with red color on
screen. Display “Cusrow Wadia” in the middle of the circle.
20. Write a program to display your name with red foreground and yellow background color in text
mode. Also the name should blink.
21. Write a program to display a text window of 10 x10 characters in the center of text mode screen.
Display your name and address in the window. Use text mode only.
22. Write a program to draw a circle of radius 10 at the center of screen and then move it to the top left
corner of screen.