Trying to create an exp(x) program
Hey all. I'm experimenting with a program that is in relation to an assignment I have. All I'm trying to do is have the user input a number, and then have the program raise "e" (as in 2.71828...) to that number. I've got something, but it's not working like I need it to. I know my program doesnt include it yet, but I want to have a printf statement saying something like "exp(x) is <answer>". Can anyone see what I'm doing wrong?
Code:
#include <stdio.h>
#include <math.h>
int main()
{
double x;
double b;
printf("Enter an exponent for base e\n");
scanf("%lf", &x);
b = double exp(x);
return(b);
}