Question
Consider the following C++ code: Â Â int a =
5; Â Â int b = 10; Â Â if (a > 0 && b < 10) { Â Â Â Â a = a + b; Â Â } else if (a == 5 || b == 10) { Â Â Â Â a = b - a; Â Â } else { Â Â Â Â a = 0; Â Â } Â Â // What is the value of 'a' after the execution of this code?Solution
Let's trace the execution with the initial values: a = 5, b = 10.   1. if (a > 0 && b < 10):     (a > 0) evaluates to (5 > 0), which is true.     (b < 10) evaluates to (10 < 10), which is false.     The entire condition true && false evaluates to false.     Therefore, the code block inside this if statement is skipped.   2. else if (a == 5 || b == 10):     (a == 5) evaluates to (5 == 5), which is true.     (b == 10) evaluates to (10 == 10), which is true.     The entire condition true || true evaluates to true.     Therefore, the code block inside this else if statement is executed.   3. Inside the else if block:     a = b - a;     Substitute the current values: a = 10 - 5;     a becomes 5.   Since an else if block was executed, the final else block is skipped.   The final value of a is 5.
What is the present Statutory Liquidity ratio (SLR) of the RBI?
Which of the following is included in the 'Cost of Inventory' according to Accounting Standard-2 (Inventory Valuation):
A _________________ is a cloud of dust and gas inside a galaxy.Â
_________ defeated Mahmud Khilji and erected the tower of victory (Vijay Stambha) in Chittorgarh.
How many hectares of forest area did India gain annually from 2010 to 2020 according to the FAO report? Â
Which artificial element has been provisionally named seaborgium by American researchers in honour of Nobel Laureate Glenn T Seaborg?
With the inclusion of Garba in 2023, how many cultural items from India have been featured on the UNESCO list of Intangible Cultural Heritage?
Which of the following options are all transition metals?
In which year did Pakistan win the Kabaddi (Circle style) World Cup?
Which of the following is the correct match of column-A with column-B?