Job Roles

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

5 5254
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

6 15354
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

3 4281
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

6 4818
Q:

How many Indian states share border with Myanmar  ?

A) 6 B) 7
C) 3 D) 4
 
Answer & Explanation Answer: D) 4

Explanation:

The four northeast Indian states share 1,643-km border with Myanmar – Arunachal Pradesh, Nagaland, Mizoram and Manipur. It is in news recently, because the Indian Government has set up an expert committee to examine the rules which allow free movement of Indian and Myanmarese citizens within 16 kms of the border, but are exploited by militants for smuggling arms, drugs, and fake Indian currency. The committee will be headed by the special secretary (Internal Security) in the Ministry of Home Affairs. The committee will give its report for uniform and effective implementation of free movement regime within 3 months. It will also prepare standard operating procedures common for all the four states so that militants, criminals and contraband are filtered at the border without causing inconvenience to genuine people.

Report Error

View Answer Report Error Discuss

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

36 12219
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

9 19089
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

11 6160
Q:

World’s largest floating Solar Farm launched in ____________.

A) Japan B) China
C) Russia D) France
 
Answer & Explanation Answer: B) China

Explanation:

China flicked the switch on the world’s largest floating solar energy plant.  The massive waterborne plant is expected to generate 40 megawatts at one time and could supply electricity for over 15,000 homes. The pioneering project, located in eastern China, is thought to cement China’s status as a top producer of solar energy in the world.  The plant has been built in Huainan city, Anhui Province, by Sungrow Power Supply, a Chinese company specialised in renewable energy.

Report Error

View Answer Report Error Discuss

Filed Under: Longest, Shortest, Deepest
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

11 4590