Subex Previous Years Solved Sample Placement Papers
-
What is the output of the following program?
#include main() { int i, j, x = 0; for (i = 0; i < 5; ++i) for (j = 0; j < 5; ++j) x += (i + j - 1); printf("%d", x); break; }
A. 1
B. 0
C. 2
D. None of the above Answer: Option D
- Solution: The program does not have a valid break statement inside a loop.
-
Consider the following:
i. Pointer to a function that accepts 3 integer arguments and returns a floating-point quantity
float(8pf)(int a, int b, int c)
ii. Pointer to a function that accepts 3 pointers to integer quantities as arguments and returns a pointer to a floating-point quantity
float *(*pf)(int *a, int *b, int *c);
A. i is true, ii is true
B. i is true, ii is false
C. i is false, ii is false
D. i is false, ii is true Answer: Option D
-
Consider the following statements:
i. An integer quantity can be added to or subtracted from a pointer variable.
ii. Two pointer variables can be added.
iii. A pointer variable can be multiplied by a constant.
iv. Two pointer variables of the same type can be subtracted.
A. Only ii & iv are true
B. Only iii is false
C. Only ii is false Answer: Option C
D. Only i & ii are true
-
If p is a pointer, what does p mean?
A. Same as *(*p+i)
B. Same as *(p+i) Answer: Option B
C. Same as *p+i
D. None of the above