+ 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?
4 Respostas
+ 2
Okhunjon Okhunov working fine .
Though I checked only for 1.571 radian and it outputs 2 which is right.
+ 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
+ 2
Abhay I updated the post, check it out if u can help me, plz)
+ 2
Abhay thank u 😁, I wasn't sure about the code