- cpp Code: Select all
int main()
{
long double t=5.0f/30.0f;
long double us=1.0f/30.0f;
cout <<int(((t)/us))<< endl;
return 0;
}
in the code above the answer should be 5 but instead its 4
int main()
{
long double t=5.0f/30.0f;
long double us=1.0f/30.0f;
cout <<int(((t)/us))<< endl;
return 0;
}
#include <iostream>
int main()
{
long double t=5.0/30.0;
long double us=1.0/30.0;
std::cout <<(int) ( (double) (t/us) )<< std::endl;
return 0;
}
Users browsing this forum: Exabot [Bot], Seven and 0 guests