Ask Question

Give the out put of the program snippet

Int a = 10, b = 12;

If (a>=10)

a++;

Else

++b;

System. out. println (" a = " + a + " and b = " + b);

+4
Answers (1)
  1. 23 July, 17:59
    0
    Output will be as follows

    a = 11

    b = 12

    Explanation:

    In this program, two values 10, and 12 assigned to two variables a and b respectively. In next step the values of a has been checked that whether it is equal to 10 or greater than 10. so according to the assigned values, a is equal to 10 so a is incremented by 1 and becomes 11. while there is no change in the value of b.

    So the output of a = 11 and b = 12.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Give the out put of the program snippet Int a = 10, b = 12; If (a>=10) a++; Else ++b; System. out. println (" a = " + a + " and b = " + b); ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers