I am writing a calculator program. I am new to C. I am having problem with the expontential function. This program adds, subtracts, etc. I have left off some of the code but I think you get the idea.
Code:
# include <stdio.h>
7
8 double power(double int1, int int2);
9
10 int main ( void )
11
12 {
13 float int1, int2, result, menu;
14
else if (menu == 5)
55 {
56
57 result = power(double int1, int int2);
58 printf("%.2lf raised to the power %d = %.2lf\n", int1, int 2, power(int1,int 2));
59
double power(double int1, int int2){
79 if ( int2 == 0)
80 return int1;
81 else
82 return int1 * power (int1, int2 - 1);
83 }
line 57 is giving me
error: expected expression before âdoubleâ
line 57
error: expected expression before âdoubleâ
line 58
expected expression before âintâ
line 58
too few arguments for format
Thanks for the help in advance.