Aspire Faculty ID #13579 · Topic: JAMIA MILLIA ISLAMIA MCA 2024 · Just now
JAMIA MILLIA ISLAMIA MCA 2024

What will be values for $a$ and $c$ after execution of the following code if $a$ is $10$, $b$ is $5$, and $c$ is $10$? if ((a > b) && (a <= c)) a = a + 1; else c = c + 1;

Solution

$a>b$ is $10>5$ (true) and $a\le c$ is $10\le10$ (true). Condition is true $\Rightarrow$ execute $a=a+1 \Rightarrow a=11$, $c$ unchanged $=10$.

Previous 10 Questions — JAMIA MILLIA ISLAMIA MCA 2024

Nearest first

Next 10 Questions — JAMIA MILLIA ISLAMIA MCA 2024

Ascending by ID
Ask Your Question or Put Your Review.

loading...