Академический Документы
Профессиональный Документы
Культура Документы
a) strcpy (char *dst,char *src) { while (*src) *dst++ = *src++; } c) strcpy (char *dst,char *src) { while(*src) { *dst = *src; dst++; src++; }}
2) main()
{
struct kk { int x=5; char name[ ]= Computer; }; struct kk *s = malloc(sizeof(struct kk)); printf(%d,s->x); printf(%s,s->name); } The Output will be a) 8Computer b) Compiler Error c) None 3) main() { int i= -1, j= -1, k=0, l=2, m; m= i++ && j++ && k++|| l++; printf("%d %d %d %d %d", i, j, k, l, m); } The output will be a) 0 0 1 3 1 b) -1 -1 0 2 0 c) 0 0 1 3 1 d) None of the above Copyright 2005 Oasis Technologies Pvt. Ltd. www.oasistech.co.in
4) Which of the following scheduling algorithms is non-preemptive? a. First-come-first-served scheduling b. Shortest-job-first scheduling c. Priority scheduling d. Round-Robin scheduling 5) The main disadvantage of threads is that a. They require large amounts of memory b. Writing of program requires very careful design. c. They consume processor time d. They are an incomplete solution
Section C: Reasoning
1) N can get a message to which of the following spies by using exactly one intermediate contact? O L P a) 1 only b) 3 only c) 1 and 3 only d) 2 and 3 only 2) Find out the missing numbers: 3 a) 63 15 ? 35 b) 69 9 143 c) 77 d) 81
J, L, M, N, O, P are the members of a spy network. For the security reasons, only certain spies are able to contact other spies. The only contacts allowed are: J can contact both L and N. L, M and P can contact O. N can contact M. O can contact both L and N. P can be contacted by M. A spy can receive a message from any spy who can contact him and, in turn, relay the message to any spy is able to contact.
N can get a message to which of the following spies by using exactly one intermediate contact? O L P a) 1 only b) 3 only c) 1 and 3 only d) 2 and 3 only How can O send a message to M? a) O can contact M directly. b) O can send message to M via J. c) O can send message to M via L. d) O can send message to M via N. If, for security reasons, O cannot be contacted, which of the following messages can be sent, either directly or with an intermediary? a) J to P b) L to M c) L to N d) M to L