I cant get the exact value when i do the multiplication with two value

Oct 3, 2018 at 2:14pm
This is my code.

1
2
3
4
5
6
7
8
  {
       double e , f;     
            cout<<"Enter 2 numbers="<<endl;
            cin>>e>>f;
            cout<<"The multiplication result is = "<<e*f<<endl;
            cout<<"\n";
}
            


when i input e= 7777.77 and f= 5555.55 , the result showed 4.32098e+007.
What was the error of my code?
Last edited on Oct 3, 2018 at 2:16pm
Oct 3, 2018 at 2:24pm
That answer looks correct to me, to within the level of precision being written out.

What, exactly, is the problem? Is it that you want more precision? Is it that you don't like exponential notation? Is it something else?

We can't read your mind.
Oct 3, 2018 at 2:30pm
Yes MikeyBoy , i dont want the exponential notation . What should i do then?
Oct 3, 2018 at 2:36pm
std::cout << std::fixed << e << " * " << f << " == " << e*f << '\n' ;
Oct 3, 2018 at 2:44pm
Thank you.
Topic archived. No new replies allowed.