SAPLAB Previous Years Solved Sample Placement Papers
-
String is given Myprog one two three. Where Myprog is an exe file. What will the output of the following program?
main(argc, argv) { printf("%c", ++**argv); }
Options:
A. m
B. n
C. none
D. myprogram
-
In 1.5 fixed format, how is -1 represented?
A. 0xFFFF Answer: Option A
B. 0xF000
C. 0x8000
D. 0x0001
-
#define Sqr(b) b*b;
main() { int i = 3; printf("%d", SQR(i + 2)); }
Ans: 11
-
main() { char c = 'a'; printf("%d %d", sizeof(c), sizeof('a')); }
Options:
A. 1 1
B. 2 2
C. 2 1
D. 1 4 Answer: Option D
-
Question related to the ICMP:
Ans: d (check out)
-
Question related to ARP (which machine will respond for the request of ARP)?
-
If an integer needs two bytes of storage, then the maximum value of an unsigned integer is:
A. 2^16-1 Answer: Option A
B. 2^15-1
C. 2^16
D. 2^15
-
If an integer needs two bytes of storage, then the maximum value of a signed integer is:
A. 2^16-1
B. 2^15-1 Answer: Option B
C. 2^16
D. 2^15
-
What is the output of printf("%d", printf("tim"));
A. results in a syntax error
B. outputs tim3 Answer: Option B
C. outputs garbage
D. prints tim and terminates abruptly
-
Length of string “correct” is:
A. 7
B. 8 Answer: Option B
C. 6
D. implementation dependent