cannot be used as a function

i am trying to write a program that calculate the interest of a loan, and i am having a problem with this line.

 
a=p(pow((1+r), t));

it keeps telling me p cannot be used as a function.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  #include <iostream>
#include <math.h>
#include <cmath>

using namespace std;

int main()
{
double t, p, r;
int a;

cout<<"what is the amount of the loan"; //ask for the amount of the loan.
cin>>p;

cout<<"enter the interest rate per year";
cin>>r;

cout<<"amount to pay back after t years";
cin>>a;

a=p(pow((1+r), t));
return 0;
a=p*(pow((1+r), t));
thank you, that worked
Topic archived. No new replies allowed.