Questions

Q:

What's the difference between the functions rand(), random(), srand() and randomize()?

Answer

rand()  returns a random number


random()  returns a random number in a specified range


srand()  initialise a random number generator with a given seed value


randomize()   initializes a random number generator with a random value based o time.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

2 4514
Q:

A cowboy arrives in town on Friday. He stays for 3 days and then leaves on Friday. How is that possible?

Answer

You will get the answer in the riddle itself, if you read the riddle carefully.


The riddle says "A cowboy arrives in town on Friday." So Friday is the name of the horse on which he comes. Hence, the only possibility is he arrives on the horse friday on Tuesday, stays for 3 days and leaves on the same horse on Friday. 

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles Exam Prep: AIEEE , Bank Exams , CAT , GATE , GRE
Job Role: Analyst , Bank Clerk , Bank PO , IT Trainer

11 4513
Q:

Who among the following is a recipient of 2017 Mother Teresa Memorial Award for Social Justice?

 

A) Kangana Ranaut B) Priyanka Chopra
C) Dipika Padukone D) Diya Mirza
 
Answer & Explanation Answer: B) Priyanka Chopra

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Honours and Awards
Exam Prep: Bank Exams

0 4513
Q:

Logical puzzle

At a restaurant, how could you choose one out of three desserts with equal probability with the help of a coin? What if the coin is biased and the bias is unknown?

Answer

Our solution:


Toss the coin twice.
Let TH, HT and TT correspond to the three choices.
And if you get HH, just repeat (so it takes 8/3 tosses on average).


BIASED COIN

If the coin was biased, TH and HT would occur with equal probability.
So you could assign THHT, HTTH and THTH to the three choices, with other 4-toss outcomes rejected.
Or you could assign HTT, THT and TTH to the three choices, with other 3-toss outcomes rejected.

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles

18 4507
Q:

Which is the only snake that builds nests?

A) Viper B) King Cobra
C) Anaconda D) Python
 
Answer & Explanation Answer: B) King Cobra

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Animals and Birds

19 4504
Q:

The Teesta River is flowing through which two Indian states ?

A) Haryana & Punjab B) Sikkim & West Bengal
C) West Bengal & Manipur D) Assam & Uttarakhand
 
Answer & Explanation Answer: B) Sikkim & West Bengal

Explanation:

The Teesta River is a 309 km long river flowing through the Indian states of West Bengal and Sikkim, before going to Bay of Bengal through Bangladesh.

Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank PO

30 4504
Q:

' Samjhauta Express ' runs between which of the following two stations

A) New Delhi - Wagah B) New Delhi - Lahore
C) Amritsar - Wagah D) Amritsar - Lahore
 
Answer & Explanation Answer: B) New Delhi - Lahore

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

9 4503
Q:

Who has been selected for the 2016 National Geoscience Award in the field of geo-environmental studies? 

A) Keshav Krishna B) Ashok Kumar Singhvi
C) P.V. Joseph D) Vishnu Deo Sai
 
Answer & Explanation Answer: A) Keshav Krishna

Explanation:

Dr. A Keshav Krishna, a scientist at the National Geophysical Research Institute (NGRI), has been selected for 2016 National Geoscience Award by the Ministry of Mines in the field of Geo-environmental studies in applied geosciences.

Report Error

View Answer Report Error Discuss

Filed Under: Honours and Awards

7 4502