What am I doing wrong?
Several things:
- Use
%.10e
format for scientific notation withprintf
for a printout with ten digits after the dot, - Return an
int
from yourmain
, - Consider not using
public
to name a variable, on the chance that your program would need to be ported to C++, wherepublic
is a keyword.
Here is how you can fix your program:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(){
double p;
double a = 16;
double b = 54;
p = (pow(a,b));
printf("%.10e\n", p);
return 0;
}