- 1
C++
You want to withdraw some money from your bank account. The program takes two numbers as input, your account balance and the amount you want to withdraw. Calculate and output the remaining balance after the withdrawal. Sample Input 450000 9000 Sample Output 441000 Attempt in comments
5 odpowiedzi
+ 1
//int withdrawl = input1 + input2;
balance = input1 - input2;
+ 1
Mando there isn't any need to make two more variables for inputs to put in withdrawl and expect to get an answer. here's the answer, apologies for responding late.
int balance;
cin >> balance;
int withdrawl;
cin >> withdrawl;
cout << balance-withdrawl;
0
#include <iostream>
using namespace std;
int main() {
int balance;
int input1;
cin >> input1;
int input2;
cin >> input2;
int withdrawl = input1 + input2;
balance-=withdrawl;
cout << balance;
return 0;
}
0
Whats that mean
- 1
Mine works?