Ask Question
9 December, 02:37

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);

+3
Answers (1)
  1. 9 December, 03:07
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers