Subex Previous Years Solved Sample Placement Papers
-
The output of the following program is:
#include main( ) { int i = -1; while(i < 5) { #ifdef _X_printf("%d", i++); #endif } }
A. Compiler error
B. -1, 0, 1, 2, 3, 4
C. Infinite loop
D. 1, 2, 3, 4
-
Ans: Compiler error (Option A)
-
The output of the following program is:
#include void f(char* p); main( ) { char *p = (char*)l; f(p); printf("%s\n", p); } void f(char *p) { char sz[] = "hello"; p = sz; }
A. Runtime error
B. NULL
C. hello
D. Compiler error
-
Ans: Compiler error (Option D)
-
The output of the following program is:
#include
void f(char **p) { char *sz = "hello"; *p = sz; } main( ) { char *p = "NULL"; f(&p); printf("%s\n", p); } A. Compiler error
B. Runtime error
C. hello Answer: Option C
D. 1
-
The output of the following program is:
#include main( ) { int n; if(n <= -1) { int x = 1; } else { int x = 1; } }
A. Compiler error Answer: Option A
B. Unpredictable output
C. 10
D. 1
-
The correct declaration of a pointer “func” to function returning a “char” and taking no parameters is:
A. char func( )* func;
B. char (*func)( ); Answer: Option B
C. char* ( ) func;
D. None of the above
-
The output of the following program is:
#include #define arbit 5 main( ) { printf("%d\n", arbit); }
A. 5 Answer: Option A
B. 6
C. Compiler error
D. Runtime error
-
Determine which of the following are valid identifiers:
- i. Return
- ii. 123 45 6789
- iii. Record_1
- iv. $Tax
A. iii & iv Answer: Option A
B. i & iii
C. i, ii & iv
D. i & iv