# GATE Questions

Q:

What is the difference between stack and array?

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.

Subject: C++ - Technology Exam Prep: GATE

4477
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

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 $\inline \fn_jvn \small \frac{6x5}{2}$ x 1
= 7 x 15 = 105.

7 2577
Q:

Which among the following are not the c++ tokens

 A) Identifiers B) keywords C) Strings D) None

Explanation:

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

- keywords

- Identifiers

- Constants

- Strings

- operators

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

2 1557
Q:

Explain fork() system call?

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.

Subject: Operating Systems Exam Prep: GATE

1528
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