1. In which of the following areas pointers are used:
i) Accessing array elements
ii) Passing address arguments to functions when the function needs to modify the original
arguments
iii) passing arrays and strings to functions
iv) obtaining memory from the system- Dynamic memory allocation.
v) creating data structures such as linked list
a. ii, iii, iv b. I, ii, v c. All d. None
2. Read the program
template
class stack
{
T st[MAX];
Int top;
Public:
stack(){ top= -1;}
void push(T var){ st[++top]=var; }
T pop( ){ return st[top--]); }
};
void main( )
{
? ss;
ss.push(‘G’);
}
To create an object which can take characters what statement should be replaced for ?
a. stack b. stack
3. Match the following:
1) cleardevice ( ) I) positions the cursor at a position in graphics screen
2) clrscr( ) ii) clears the graphical screen
3) gotoxy( ) iii) positions the cursor in text window
4) moveto ( ) iv) clears the text window
a. 1- ii, 2- iv, 3- iii, 4- I b. 1- iii, 2- iv 3- ii, 4 – I c. 1- I, 2- ii, 3- iii, 4- iv d. 1- iv, 2- iii, 3- ii,4-I
4.Which of the following is the correct syntax of circle()
a. circle( int col, int row, int radius)
b. circle( int row,int col, int radius)
c. circle( int col, int row,int radius, int color)
d. circle(int row, int col, int radius, int color)
5. Match the functions with number of their arguments
1) line( ) I) int col, int row, int haxis, int vaxis
2) arc( ) ii) int col, int row, int stangle, int e_angle,int hor_rad,int ver_rad
3) ellipse( ) iii) int col,int row, int stangle, int eangle, int rad
4) fillellipse( ) iv) int col,int row,int col, int row
a. 1-ii, 2-iv, 3- iii, 4- I b. 1-iii, 2- iv,3- ii, 4-I c. 1-I,2-ii, 3-iii, 4- iv d. 1-iv,2-iii, 3- ii,4-I
6.Match the functions with their functionality
1) getx( ) I) returns the number of pixels in each row
2) getpixel( ) ii) returns the x coordinate
3) getmaxx( ) iii) plots the pixel at the specified location
4) putpixel( ) iv) returns an integer representing the colour of the pixel
a. 1- ii, 2- iv, 3- I, 4- iii b. 1-I, 2-ii, 3- iii, 4- iv c.1- iii, 2- I, 3-iv, 4- ii d. 1- iv,2- iii, 3- ii, 4- I
7. Match the functions with their functionality
1) detectgraph( ) I) It initializes the graphics system
2) initgraph( ) ii) releases memory of graphics system
3) cleardevice( ) iii) checks the system for graphics
4) closegraph( ) iv) clears the graphics window and places the cursor in (0,0)
a. 1-ii, 2- iv, 3- I, 4- iii b. 1-1, 2-ii, 3- iii, 4- iv c. 1- iii, 2- I, 3- iv, 4- ii d. 1-iv, 2- iii, 3-ii, 4- i
four mark
1. c
2. b
3. a
4.a
5.d
6.a
7.c