C/C++/OS/DS/Networking Test Set 3

1)   C: Trace the output

int main()

    {

char c[]="CAREERRIDE";
char *p=c;
printf ("%s",p+p[3]-p[1]);
return 0;

    }


a. CAREERRIDE
b. ERRIDE
c. REERRIDE
d. None of the above.
Answer  Explanation 

ANSWER: ERRIDE

Explanation:
No explanation is available for this question!


2)   C programming: The default parameter passing mechanism is called as

a. function call
b. call by value.
c. call by reference.
d. None of the above.
Answer  Explanation 

ANSWER: call by value.

Explanation:
No explanation is available for this question!


3)   C programming:The given expression  P– = Q+1 is same as

a. P=P – Q – 1
b. P=P – Q + 1
c. P= –P + Q + 1
d. None of the above.
Answer  Explanation 

ANSWER: P=P – Q – 1

Explanation:
No explanation is available for this question!


4)   C programming : Trace the output

int main()

    {

char c='A';
switch(c)
   {
case 'A': printf("Choice B\n");
case 'C':
case 'D':
case 'E':printf("Choice E\n");
default: printf("No Choice \n");

   }
return 0;

    }


a. Choice B
b. Choice E
c. No Choice

Answer  Explanation 

ANSWER: Choice B

Explanation:
No explanation is available for this question!


5)   C programming : Trace the output

While(“%d” , printf(“abc”))
    {
Printf(“de”);
    }


a. abcdeabcdeabcde……………
b. abdededede…………………
c. Compile error.
d. None of the above.
Answer  Explanation 

ANSWER: abcdeabcdeabcde……………

Explanation:
No explanation is available for this question!


6)   C Programming :Trace the output
int main()
{

int x;

for(x=1;x <=10;x++);

printf("%d",x);

return 0;

}


a. 1 2 3 4 5 6 7 8 9 10
b. 10
c. 11
d. None of the above.
Answer  Explanation 

ANSWER: 11

Explanation:
No explanation is available for this question!


7)   C++: Choose the correct statement.

a. Constructor cannot be inherited.
b. Destructor cannot be inherited.
c. Constructor cannot be called explicitly.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


8)   C++: Which of the following is not post increment?

a. x++
b. ++x
c. x=x+1;
d. x+=1
Answer  Explanation 

ANSWER: ++x

Explanation:
No explanation is available for this question!


9)   C++: Which of the following keywords allows the method resolution at run time?

a. abstract
b. override
c. virtual
d. None of the above.
Answer  Explanation 

ANSWER: None of the above.

Explanation:
No explanation is available for this question!


10)   In C++ which operator cannot be overloaded?

a. :: (Scope resolution operator)
b. = (Assignment operator)
c. == (equality operator)
d. -> (arrow operator)
Answer  Explanation 

ANSWER: :: (Scope resolution operator)

Explanation:
No explanation is available for this question!


11)   C++: If you have declared a static member in a class, then how many copies of static member are shared between objects?

a. Separate copy of the static member is created for all objects of the class.
b. Single copy of the static member is shared by all objects of the class.
c. Only static function are shared between objects not variable.
d. None of the above.
Answer  Explanation 

ANSWER: Single copy of the static member is shared by all objects of the class.

Explanation:
No explanation is available for this question!


12)   What is namespace in C++?

a. It provides space between names.
b. namespace reserve the memory of variable at run time.
c. Namespaces provide a method for preventing name conflicts or name clashes
d. None of the above.
Answer  Explanation 

ANSWER: Namespaces provide a method for preventing name conflicts or name clashes

Explanation:
No explanation is available for this question!


13)   OS: Resources are allocated to the process on non-sharable basis is

a. mutual exclusion
b. hold and wait
c. no pre-emption
d. circular wait
Answer  Explanation 

ANSWER: mutual exclusion

Explanation:
No explanation is available for this question!


14)   OS: If the disk head is located initially at 32, find the number of disk moves required with FCFS if the disk queue of I/O blocks requests are 98, 37, 14, 124, 65, 70.

a. 320
b. 321
c. 324
d. None of the above
Answer  Explanation 

ANSWER: 324

Explanation:
No explanation is available for this question!


15)   What are the necessary conditions to occur the deadlock?

a. Sharable resource, Hold and wait, Preemption, Circular wait.
b. Mutual exclusion, Hold and wait, No preemption, Circular wait.
c. Mutual exclusion, Hold and wait, Preemption, Circular wait.
d. None of the above.
Answer  Explanation 

ANSWER: Mutual exclusion, Hold and wait, No preemption, Circular wait.

Explanation:
No explanation is available for this question!


16)   OS: Shell is the exclusive feature of which software?

a. UNIX
b. DOS
c. System software
d. Application software
Answer  Explanation 

ANSWER: UNIX

Explanation:
No explanation is available for this question!


17)   OS: Which scheduler performs the "swapping out" or "swapping in"?

a. Long-term scheduling
b. Medium-term scheduling
c. Short-term scheduling
d. None of the above.
Answer  Explanation 

ANSWER: Medium-term scheduling

Explanation:
No explanation is available for this question!


18)   Operating system supports different page replacement policy. From the given below option which is not a valid page replacement policy?

a. Least Recently Used
b. First in first out
c. Currently used policy
d. Optimal page replacement policy
Answer  Explanation 

ANSWER: Currently used policy

Explanation:
No explanation is available for this question!


19)   Data Structure: The postfix expression PQ + RS – * can be evaluated using a

a. Stack
b. Tree
c. Queue
d. LinkList
Answer  Explanation 

ANSWER: Stack

Explanation:
No explanation is available for this question!


20)   Leaves of which of the following trees are at the same level?

a. Binary tree
b. B-tree
c. AVL-tree
d. Normal Tree
Answer  Explanation 

ANSWER: B-tree

Explanation:
No explanation is available for this question!


21)   If you traverse a tree in the Inorder and find sorted listing of elements then it is a

a. Binary search tree
b. Binary tree
c. Heap
d. None of the above.
Answer  Explanation 

ANSWER: Binary search tree

Explanation:
No explanation is available for this question!


22)   From the given below option find out the linear type data structure.

a. Strings
b. Lists
c. Queues
d. All of the above
Answer  Explanation 

ANSWER: Lists

Explanation:
No explanation is available for this question!


23)   There are different ways of traversing a binary tree. What are those traversing technique?

a. Prefix, infix, postfix
b. Pre-order, in-order, post-order
c. Pre-traversal, in-traversal, post-traversal
d. None of the above.
Answer  Explanation 

ANSWER: Pre-order, in-order, post-order

Explanation:
No explanation is available for this question!


24)   Evaluate the postfix expression 3574-2^*+

a. 41
b. 45
c. 48
d. None of the above.
Answer  Explanation 

ANSWER: 48

Explanation:
No explanation is available for this question!


25)   Which OSI layer is responsible for delivery of data packets from source to destination?

a. Transport layer.
b. Network layer.
c. Data layer.
d. None of the above.
Answer  Explanation 

ANSWER: Network layer.

Explanation:
No explanation is available for this question!


26)   Choose the correct option about Internetworking protocol (IP).

a. Internetworking protocol (IP) is an unreliable and connectionless protocol.
b. IP transports data in packets called datagrams.
c. Option A and B are correct.
d. None of the above.
Answer  Explanation 

ANSWER: Option A and B are correct.

Explanation:
No explanation is available for this question!


27)   Which OSI layer is responsible for delivery of data packets from node to node?

a. Transport layer.
b. Network layer.
c. Data layer.
d. None of the above.
Answer  Explanation 

ANSWER: Data layer.

Explanation:
No explanation is available for this question!


28)   Which protocol is used to find the physical address of the node when its Internet address is known?

a. Address Resolution Protocol (ARP)
b. Reverse Address Resolution Protocol (RARP)
c. ICMP
d. None of the above.
Answer  Explanation 

ANSWER: Address Resolution Protocol (ARP)

Explanation:
No explanation is available for this question!


29)   The hamming distance between 001111 and 010011 is.

a. 1
b. 2
c. 3
d. 4
Answer  Explanation 

ANSWER: 3

Explanation:
No explanation is available for this question!


30)   If there are n devices (nodes) in a network what is the number of cable links required for a mesh topology?

a. n
b. n (n-1)
c. n-1
d. None of the above.
Answer  Explanation 

ANSWER: n (n-1)

Explanation:
No explanation is available for this question!