All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 03 · MOCK TEST

Programming Languages and Computer Graphics — Mock Test 1

25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.

0 / 25 answered 00:00
Q1. Match the LIST-I with LIST-II
LIST-ILIST-II
A. long signed intI. %lf
B. doubleII. %Lf
C. long doubleIII. %c
D. unsigned characterIV. %ld
Choose the correct answer from the options given below:
Q2. Which of the following are correct about constructors in C++?
A. They have the same name as the class.
B. They can return values.
C. They are called automatically when an object is created.
D. They can be overloaded.
E. They can be inherited.
Choose the correct answer from the options given below:
Q3. Arrange the following data types in non-decreasing order according to the length of their representation in C++.
A. char
B. int
C. float
D. double
Choose the correct answer from the options given below:
Q4. Which of the following would be the value of z for the C program code?
x = 16;
y = 4;
z = x >> y;
Q5. What will be the output of the following program?
#include<stdio.h>
int main()
{ int i;
for (i = 0; i++<10; )
printf("%d", i++);
return 0;
}
Q6. Match the LIST-I with LIST-II.
LIST-ILIST-II
A. Pivot pointI. Reflection
B. Fixed pointII. Shear
C. Mirror imageIII. Rotation
D. DistortionIV. Scaling
Choose the correct answer from the options given below:
Q7. The number of pixel columns divided by the number of scan lines that can be displayed by the system, is called
Q8. The above figure shows a triangle at an original position (vertices labelled 2, 1, 3) to the left of the y-axis, and the same triangle, filled/hatched, at a reflected position (vertices labelled 2, 1, 3) to the right of the y-axis, mirrored about the vertical axis.
A. Reflection of object about x axis.
B. Reflection of object about y axis.
C. Reflection of object about x = 0
D. Reflection of object about y = 0
Choose the correct answer from the options given below:
Q9. What will be the output of the following C programming code:
int i, j;
for(i=1; i<5; i+=2)
  for(j=1; j<i; j+=2)
    printf("%d", j);
Q10. What would be the equivalent pointer expression for referring the array element ar[m][n][0]?
Q11. Which of the following techniques is used for Clipping?
Q12. Consider the following piece of C programming code:
int x=128, y=110;
do
{
  if(x>y)
    x=x-y;
  else
    y=y-x;
} while(x!=y);
printf("%d",x);
Which one will be the output?
Q13. Match List I with List II
List IList II
A. OverloadingI. Since function call is resolved during run time, the execution is slow.
B. Early bindingII. Since function call is resolved during compilation time, the execution is much faster.
C. OverridingIII. Supports compile-time polymorphism.
D. Late BindingIV. Supports run-time polymorphism.
Q14. Consider the following statements for XML (Extensible Markup Language):
A. The number of tags decreases and users can define their own tags.
B. It is used for Presentation.
C. It is case sensitive.
D. It is dynamic.
Which of the above statements are true?
Q15. Match List I with List II
List IList II
A. Oblique ProjectionI. When the direction of projection is so chosen that the lines perpendicular to the plane of projection are foreshortened.
B. Cavalier ProjectionII. When the direction of projection is so chosen that there is no foreshortening of lines perpendicular to the plane of projection.
C. Cabinet ProjectionIII. When the direction of projection is perpendicular to the plane of projection.
D. Orthographic ProjectionIV. When the angle between the projectors and the plane of projection is not equal to 90°.
Q16. What will be the output of the following C programming code:
void main()
{
  int *i, a=12, b=2, c;
  c = (a=a+b, b=a/b, a=a*b, b=a-b);
  i = &c;
  printf("%d", --(*i));
}
Q17. Only legal pointer operations:
A. pointer + number → pointer
B. pointer − number → number
C. pointer + pointer → pointer
D. pointer − pointer → pointer
E. pointer − pointer → number
Choose the most appropriate answer from the options given below:
Q18. Consider the operators used in C Programming given below:
A. &&
B. +=
C. >>
D. >=
E. ?:
Choose the correct order of precedence of the operators given above (higher to lower):
Q19. Consider the conditional statement if (m == 20 − 10 || n > 10). The order of execution of the following operations is
A. ==
B. −
C. ||
D. >
Choose the correct answer from the options given below:
Q20. Which of the following is NOT true about Global Variables?
Q21. Arrange the 2-D viewing transformation pipeline.
A. Convert world coordinates to viewing coordinates
B. Map viewing coordinates to normalized viewing coordinates using window-viewport specifications
C. Construct world-coordinate scene using modeling-coordinate transformations
D. Map normalized viewport to device coordinates
Choose the correct answer from the options given below:
Q22. The entire set of parameters, including the return address, that is stored for a procedure invocation is referred to as
Q23. Consider the following statements:
int x = 10, y = 15;
x = ((x == y) ? (y + x) : (y - x));
What will be the value of x after executing these statements?
Q24. The major adverse side effects of scan conversion are:
A. Staircase appearance
B. Unequal brightness of slanted lines
C. Picket fence problem
D. Rasterization
E. Pre-filtering and Post-filtering
Choose the correct answer from the options given below:
Q25. Match List I (Functions) with List II (Uses of functions)
List IList II
A. fseek()I. Gives the current position in the file
B. ftell()II. Sets the position to the beginning of the file
C. feof()III. Sets the position to a desired point in the file
D. rewind()IV. Used to test for an end of file condition