GATE Questions

Q:

What is the difference between stack and array?

Answer

Stack:


 - Stack is a ordered collection of items


 - Stack is a dynamic object whose size is constantly changing as items are pushed and popped .


 - Stack may contain different data types


Array:


- Array is an ordered collection of items


- Array is a static object i.e. no of item is fixed and is assigned by the declaration of the array


- It contains same data types.

Report Error

View answer Workspace Report Error Discuss

Subject: C++ - Technology Exam Prep: GATE

12 4475
Q:

There are three rooms in a Hotel: one single, one double and one for four persons. How many ways are there to house seven persons in these rooms ?

A) 105 B) 7! x 6!
C) 7!/5! D) 420
 
Answer & Explanation Answer: A) 105

Explanation:

Choose 1 person for the single room & from the remaining choose 2 for the double room & from the remaining choose 4 people for the four person room,

Then, 7C1 x 6C2 x 4C4
     = 7 x  x 1
     = 7 x 15 = 105.
Report Error

View Answer Workspace Report Error Discuss

7 2532
Q:

Which among the following are not the c++ tokens

A) Identifiers B) keywords
C) Strings D) None
 
Answer & Explanation Answer: D) None

Explanation:

All the above listed options are c++ tokens .They  include:

             - keywords

             - Identifiers

             - Constants

             - Strings

             - operators

Report Error

View Answer Workspace Report Error Discuss

Filed Under: C++ - Technology
Exam Prep: GATE

2 1553
Q:

Explain fork() system call?

Answer

The `fork()’ used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. We can tell which is which by checking the return value from `fork()’. The parent gets the child’s pid returned to him, but the child gets 0 returned to him.

Report Error

View answer Workspace Report Error Discuss

Subject: Operating Systems Exam Prep: GATE

1 1518
Q:

Every year before the festive season, a brand store increases the price of the product by 42% and then introduce two successive discount of 10% and 11% respectively. What is percentage loss and percentage gain ?

A) 3.25% loss B) 13.742% loss
C) 3.25% gain D) 13.742% gain
 
Answer & Explanation Answer: D) 13.742% gain

Explanation:

Let CP = 100,
42 % increase => SP = 142
10 % discount in SP => ((142 x 10)/100) = 14.2
So 1st SP = (142 - 14.2) = 127.8, again 12 % discount in 1st SP ((127.8 x 11)/100) = 14.058
2nd SP = (127.8 - 14.058) = 113.742,
So finally CP = 100, SP = 113.742, => gain = 13.742%.

Report Error

View Answer Workspace Report Error Discuss

3 1458