#include<iostream> #include<math.h> using namespace std; int main() { double x=0.5,result; result =cos(x); cout<<"cos("<<x<<")=" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

#include<iostream> #include<math.h> using namespace std; int main() { double x=0.5,result; result =cos(x); cout<<"cos("<<x<<")="

8th Jan 2020, 2:29 PM
Ķaņï Ķańï
Ķaņï Ķańï - avatar
2 Answers
+ 1
You're on the right track. Just add also the result to print. Also have in mind the cos function takes arguments in radians. For degrees you need x*(180/PI).
8th Jan 2020, 3:28 PM
Mihai Apostol
Mihai Apostol - avatar
0
Please read this tips on posting a question 👍 https://www.sololearn.com/Discuss/333866/?ref=app
8th Jan 2020, 3:29 PM
Ipang