+ 1

Plz, help me to debug my code!

I'm not really good at C++ and not sure if this code is correct. Plz, help me to debug it #include <iostream> #include <math.h> using namespace std; int main() { setlocale(0, "English"); double A, s1, s2, y; system("cls"); cin>>A; cout<<"Input A:"<<A<<endl; s1=sin(2*(A))+sin(5*(A))-sin(3*(A)); s2=cos(A)+1-2*pow(sin(2*(A)), 2); y=s1/s2; cout<<"y="<<y; system("pause"); return 0; } This is what that code above should do https://www.dropbox.com/s/as8pw10gmlxbjjj/IMG_20210225_012032.jpg?dl=0 https://code.sololearn.com/cuKevv8t0Mmn/?ref=app Is everything okey with this code?

24th Feb 2021, 7:59 PM
Anthony
Anthony - avatar
4 Answers
+ 2
Okhunjon Okhunov working fine . Though I checked only for 1.571 radian and it outputs 2 which is right.
24th Feb 2021, 9:07 PM
Abhay
Abhay - avatar
+ 2
Though i don't know much about c++ but i could have tried only if i knew what is program suppose to do and what are inputs and output
24th Feb 2021, 8:15 PM
Abhay
Abhay - avatar
+ 2
Abhay I updated the post, check it out if u can help me, plz)
24th Feb 2021, 8:24 PM
Anthony
Anthony - avatar
+ 2
Abhay thank u 😁, I wasn't sure about the code
25th Feb 2021, 2:10 AM
Anthony
Anthony - avatar