Hello!I am trying to make a programm at c++ which will read grads and will give degs.The only problem i have is that when i give an integer as grad,the programm doesn't return to me the right numbers as sec.it always returns 0 or 60 or something else with "e".i think the problem is that grads are declared as double,but i can't understand why.
the programm is this:
// ba8moi se moires
#include <iostream>
using namespace std;
I don't see any pointers here, Nahiyan. I see C++-style references, but not pointers.
EDIT: Nahiyan edited his post. Yes, please read that article for future posts, pel k.
Try adding .0s to all the numbers in your grads2deg function. This was C++ will know for sure that you meant to make them doubles.
i have already tried that but it had no effect.thanks,anyway...i also read this site but i couldn't understand what bothered you that much,Nahiyan.it whould help me if you could tell me in order not to make the same mistakes again...
[// ba8moi se moires
#include <iostream>
using namespace std;
cout<<"degs are "<<x_deg<<" degs, "<<x_min<<" mins and "<<x_sec<<" secs.";
return 0;
}]
is that what you mean about code?sorry about your time but i am new and the site above helped me,but not as i much as i would like to...
When I inputted 89.3 grads, my output was 80 degs, 22 mins and 12 secs., while 89.7 came out as 80 degs, 43 mins and 48 secs. Seems to be working okay, I think.