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?

14th Oct 2018, 6:54 AM
Tom Lemke
Tom Lemke - avatar
5 Answers
+ 1
like: pow(x,5)+3*cos(x)+exp(4*x)-7
14th Oct 2018, 10:50 AM
KrOW
KrOW - avatar
14th Oct 2018, 7:40 AM
KrOW
KrOW - avatar
+ 1
Thank you :)
14th Oct 2018, 2:35 PM
Tom Lemke
Tom Lemke - avatar
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; }
14th Oct 2018, 10:03 AM
Tom Lemke
Tom Lemke - avatar
0
👍👍👍
14th Oct 2018, 2:38 PM
KrOW
KrOW - avatar