iGate Previous Years Solved Sample Placement Papers
-
Declaration: `enum cities{bethlehem, jericho, nazareth=1, jerusalem}`
Assign value 1 to:(a) bethlehem
(b) nazareth (Ans)
(c) bethlehem & nazareth
(d) jericho & nazareth
-
#include
Choose the correct option:#include void main() { char buffer[82] = {80}; char *result; printf("Input line of text, followed by carriage return: "); result = cgets(buffer); printf("text=%s", result); } (a) printf("length=%d", buffer[1]);
(b) printf("length=%d", buffer[0]); (Ans)
(c) printf("length=%d", buffer[81]);
(d) printf("length=%d", buffer[2]);
-
Consider `scanf` and `sscanf` functions, which is true:
(a) No standard function called sscanf
(b) sscanf(s,...) is equivalent to scanf(...) except that input characters are taken from string s. (Ans)
(c) sscanf is equivalent to scanf.
(d) None of the above.
-
#include
What does `scanf` do?main() { char line[80]; scanf("%[^ ]", line); printf("%s", line); } (a) Compilation error. Illegal format string.
(b) Terminates reading input into variable line. (Ans)
(c) Other options not remembered.
(d) Other options not remembered.
-
`ceil(-2.8)`?
(a) 0
(b) -3.0
(c) -2.0 (Ans)
(d) 2
-
for (p = head; p != null; p = p->next) free(p);
What happens?(a) Program runs smoothly.
(b) Compilation error.
(c) Runtime error. (Ans)
(d) None of the above.
-
int x[3][4] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
What is true?(a) x[2][1] = x[2][2] = x[2][3] = 0
(b) Value in fourth column is zero
(c) Value in last row is zero
(d) None of the above. (Ans)
-
Problem was big, could not be remembered.
No details available.
-
main() { printf("%u", main()); }
What happens?(a) Prints garbage.
(b) Execution error.
(c) Prints starting address of function main. (Ans)
(d) Infinite loop.
-
int a, *b = &a, **c = &b; ... a = 4; **c = 5;
What happens?(a) Does not change value of a
(b) Assign address of c to a
(c) Assign value of b to a
(d) Assign 5 to a. (Ans)