So I need to create this calculation in a program. Yes this is HW but I am having the utter most difficult time with this. I just need some help understanding why I can't get this to work.
Now honestly, I am very terrible with math and when I saw this equation, be honest, don't know how to even begin solving.
Any help would be much appreciated. This is the code I have thus far. The formula I need to create is below.
Note: variable a,b,c require user input.
Code:
#include <stdio.h>
#include <math.h>
main()
{
float a, b, c;
float neper, powNeper, solution;
float e = 2.71828, pi = 3.1415926;
printf("\nThis program will calculate 1/2*sqrt(pi/a)*neper number to the (b^2-4ac)/4a power");
printf("\nwhere variables a-c are inputed by you.");
printf("\nNote: Pi=3.1415926 (approximately), Neper Number=2.71828 (approximately)");
printf("\n\na = ");
scanf("%f", &a);
fflush(stdin);
printf("\nb = ");
scanf("%f", &b);
fflush(stdin);
printf("\nc = ");
scanf("%f", &c);
b = pow(b, 2);
powNeper = (b - (4 * a*c)) / (4 * a);
neper = pow(e, powNeper);
solution = (1 / 2) * (sqrt(pi / a)) * neper;
printf("/n%.5f", solution);
getch();
}