I am new to programming, learning online and via books. Would appreciate help with this Double error, which states:
$g++ /tmp/13642987312818.cpp -o /tmp/13642987312818 -lm 2>&1
/tmp/13642987312818.cpp: In function 'int main()':
/tmp/13642987312818.cpp:33: error: expected primary-expression before 'double'
/tmp/13642987312818.cpp:33: error: expected `;' before 'double'
Code:
#include <stdio.h>
#include <math.h>
#define C 3
int main()
{
int v, w;
float f;
int i, e;
double x;
char n[4];
printf ("Which species?\n");
scanf(" %s",n);
printf(" %s\n",n);
printf ("What Vm?\n");
scanf (" %d",&v);
printf(" %d\n", v);
printf("Conc in?\n");
scanf(" %d",&i);
printf(" %d\n", i);
printf("Conc out?\n");
scanf(" %d",&e);
printf(" %d\n", e);
w=i+e;
x=double log(w);
f = v - (C*x);
printf("%f\n",f);
return 0;
}
Input:
Ca2+
-60
15
150
Thanks !