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

15 5418
Q:

What was the day of the week on 17th June, 1998 ?

A) Monday B) Tuesday
C) Wednesday D) Friday
 
Answer & Explanation Answer: C) Wednesday

Explanation:

17th June, 1998 = (1997 years + Period from 1.1.1998 to 17.6.1998)
Odd days in 1600 years = 0
Odd days in 300 years = 1
97 years has 24 leap years + 73 ordinary years.
Number of odd days in 97 years ( 24 x 2 + 73) = 121 = 2 odd days.
Jan. Feb. March. April. May. June.
(31 + 28 + 31 + 30 + 31 + 17) = 168 days
168 days = 24 weeks = 0 odd day.
Total number of odd days = (0 + 1 + 2 + 0) = 3.
Given day is Wednesday.

Report Error

View Answer Workspace Report Error Discuss

14 4702
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

8 3844
Q:

Ram sell his goods 25% cheaper than Shyam and 25% dearer than Bram. How much % is Bram's good cheaper than Shyam ?

A) 60% B) 40%
C) 50% D) 30%
 
Answer & Explanation Answer: B) 40%

Explanation:

Lets say shyam sells at 100,

Since Ram sells 25% cheaper than Shyam,

Therefor Ram sells at less than 25% of100 or 75 rs.

Ram sells 25% dearer than Bram or 125% of Ram =100% of Bram or

125% of x (say x price of bram )=75rs.
or 100% of x =60rs.
hence price of bram is 60rs.

now Bram's good is cheaper than Shyam's as (100-60)x100/100% or 40%.

Hence Brams Good is 40% cheaper than that of Shyam's good.

Report Error

View Answer Workspace Report Error Discuss

8 2412
Q:

A number is increased by 20% and then decreased by 20%, the final value of the number is ?

A) increase by 2% B) decrease by 3%
C) decrease by 4% D) increase by 5%
 
Answer & Explanation Answer: C) decrease by 4%

Explanation:

Here, x = 20 and y = - 20
Therefore, the net % change in value
= %
%  or  - 4%
Since the sign is negative, there is a decrease in value by 4%.

Report Error

View Answer Workspace Report Error Discuss

7 2265