0
Sin Cos tg headache
Hey guys! I just started my C++ journey and found myself in a rough spot. How do you make the below function work? f(x) = x^5 + 3*cosx + e^4x-7 Obviously I should make the equation simple, but how? Any hint?
5 Antworten
+ 1
like:
pow(x,5)+3*cos(x)+exp(4*x)-7
+ 1
Thank you :)
0
Thank you,
However not sure how to include it into my code:
#include "stdafx.h"
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#define M_E 2.71828182845904523536
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{double x;
cout<<"function value f(x) = x^5 + 3 cos x + e^4x-7"<<endl;
cout<<"Give x = ";
cin>>x;
x=pow(x, 5)+pow(M_E, 4*x-7);
cout<<"f(x) = ";
cout<<x;
getchar();
getchar();
return 0;
}
0
👍👍👍