Searching for "he"

Q:

Give an example for the use of volatile keyword in c++ ?

Answer

Most of the times compilers will do optimization to the code to speed up the program. For example in the below code,


int k = 15;
while( k == 15)


{
// Do something
}


compiler may think that value of 'k' is not getting changed in the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario, the value of 'k' may be getting updated from outside of the program.


Volatile keyword is used to tell compiler that the variable declared using 'volatile' may be used from outside the current scope, so that compiler won't apply any optimization. This matters only in case of multi-threaded applications.


In the above example if variable 'k' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

Report Error

View answer Workspace Report Error Discuss

Q:

A fair six-sided die is rolled twice. What is the probability of getting 4 on the first roll and not getting 6 on the second roll ?

A) 1/36 B) 5/36
C) 1/12 D) 1/9
 
Answer & Explanation Answer: B) 5/36

Explanation:

The two events mentioned are independent.

The first roll of the die is independent of the second roll. Therefore the probabilities can be directly multiplied.

P(getting first 4) = 1/6

P(no second 6) = 5/6

Therefore P(getting first 4 and no second 6) = 1/6 x 5/6 = 5/36

Report Error

View Answer Report Error Discuss

Filed Under: Probability
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO

Q:

Let K and L be events on the same sample space, with P (K) = 0.8 and P (B) = 0.6. Are these two events are disjoint ?

A) TRUE B) FALSE
Answer & Explanation Answer: B) FALSE

Explanation:

These two events cannot be disjoint because P(K) + P(L) > 1.


P(AꓴB) = P(A) + P(B) - P(AꓵB).


An event is disjoint if P(A ꓵ B) = 0. If K and L are disjoint P(K ꓴ L) = 0.8 + 0.6 = 1.4


And Since probability cannot be greater than 1, these two mentioned events cannot be disjoint.

Report Error

View Answer Workspace Report Error Discuss

Subject: Probability
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Bank Clerk , Bank PO

Q:

Who was the first posthumous recipient of Bharat Ratna  ?

A) B.R. Ambedkar B) Lal Bahadur Shastri
C) K. Kamraj D) M.G. Ramachandran
 
Answer & Explanation Answer: B) Lal Bahadur Shastri

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Personalities

Q:

Which state government has inaugurated the upgraded version of police helpline Namma 100, where police officials will be deputed within 15 minutes to the spot of emergency  ?

A) Karnataka B) Telangana
C) Tamil Nadu D) Madhya Pradesh
 
Answer & Explanation Answer: A) Karnataka

Explanation:

Karnataka CM Siddaramaiah has inaugurated the upgraded version of police helpline Namma 100, where police officials will be deputed within 15 minutes to the spot of emergency, for Bengaluru. Based on the model adapted in London, which has helpline 999, and USA, where 911 helpline operates, Namma 100 helpline allows the public to access several facilities on a single number.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

Q:

Eminent poet, litterateur and Jnanpith awardee C. Narayana Reddy who passed away in June 2017, he was a famous poet of _________ and ____________ language.

A) Kannada and Hindi B) Telugu and Malayalam
C) Hindi and Urdu D) Telugu and Urdu
 
Answer & Explanation Answer: D) Telugu and Urdu

Explanation:

Eminent poet, litterateur and Jnanpith awardee C. Narayana Reddy, popularly known as CiNaRe, passed away.  CiNaRe was known for his use of Telugu in its pure form, and would not be swayed by filmmakers on the use of the language. He was awarded the Padma Shri in 1977 and the Padma Bhushan in 1992. His compilation of poems, titled ‘Viswambhara’, got him the Jnanpith award in 1988. In 1997, he was nominated as a Member of the Rajya Sabha.

Report Error

View Answer Report Error Discuss

Filed Under: Famous Personalities
Exam Prep: Bank Exams , CAT
Job Role: Bank Clerk

Q:

Two trains are moving in opposite directions at 60 km/hr and 90 km/hr. Their lengths are 1.10 km and 0.9 km respectively. The time taken by the slower train to cross the faster train in seconds is ?

A) 42 sec B) 44 sec
C) 46 sec D) 48 sec
 
Answer & Explanation Answer: D) 48 sec

Explanation:

Relative speed = 60 + 90 = 150 km/hr.

= 150 x 5/18 = 125/3 m/sec.

Distance covered = 1.10 + 0.9 = 2 km = 2000 m.

Required time = 2000 x 3/125 = 48 sec.

Report Error

View Answer Report Error Discuss

Filed Under: Problems on Trains
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Bank Clerk , Bank PO

Q:

The book “Indira Gandhi – A life in Nature”, authored by _____________.

A) Jairam Ramesh B) Anand Sharma
C) Ghulam Nabi Azad D) Chetan Bhagath
 
Answer & Explanation Answer: A) Jairam Ramesh

Explanation:

The book “Indira Gandhi – A life in Nature”, was launched by Congress president Sonia Gandhi at the Indira Gandhi Memorial in the presence of former ministers, bureaucrats and environmentalists who worked closely with her to frame some of country’s landmarks wildlife and environment laws. Renowned mountaineer Capt Manmohan Singh Kohli recalled how Gandhi once told him “please call me as a daughter of the mountains”. The book has been written by former Union minister Jairam Ramesh and it has been published by Simon & Schuster.

Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors
Exam Prep: Bank Exams
Job Role: Bank PO