0%
0 / 15 answered

if Statements Practice Test

15 Questions
Question
1 / 15
Q1

A bank app blocks withdrawals that exceed the available balance. Which condition must be met for balance to decrease?


int balance = 200;

int withdrawAmount = 150;

// Withdraw only if funds are sufficient

if (withdrawAmount <= balance) {

    balance = balance - withdrawAmount;

}

System.out.println(balance);

Question Navigator