ATM withdrawal:
Conditions:
1.Balance 5000$.
2.If Balance is below than 5000 , give this information like 'Withdrawal successfully'
3.If Balance is more than 5000 , give this information like 'Withdrawal Failed'
Program:
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int withdrawl=sc.nextInt();
int balance=5000;
if(withdrawl<balance){
System.out.println("Withdrawl Sucessfull");
}
else{
System.out.println("Withdrawl Failed");
}
}
}
Output:
49999
Withdrawl Failed
Top comments (0)