hi there i can't seem to find my error :( i've put my error at the bottom of the code. btw this is my first post:)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <iostream>
using namespace std;
{
int zero_both(int n1, int n2) ; //get loan balance
}
int main()
{
int price, down_payment;
cout << "Please enter the price amount: \n";
cin >> price ;
cout << "Please enter the down payment: \n";
cin >> down_payment ;
int loan_balance = zero_both(int n1, int n2);
return 0;
}
//function call
int zero_both(int n1, int n2) //n1 = price, n2 = down payment
{
//n3 = loan_balance
int n3 = n1 - n2 ;
return n3;
}
|
chap4pp8.cpp:14:1: error: expected unqualified-id before ‘{’ token
{
^
chap4pp8.cpp: In function ‘int main()’:
chap4pp8.cpp:27:32: error: expected primary-expression before ‘int’
int loan_balance = zero_both(int n1, int n2); //zero_both(price, down_payment);
^
chap4pp8.cpp:27:40: error: expected primary-expression before ‘int’
int loan_balance = zero_both(int n1, int n2); //zero_both(price, down_payment);
^
chap4pp8.cpp:27:46: error: ‘zero_both’ was not declared in this scope
int loan_balance = zero_both(int n1, int n2); //zero_both(price, down_payment);