Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip> // manipulation (libreria di manipolazione)
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. double x=1.7356 , y=2.337, z= 2.0, a=2.0;
  8.  
  9. cout << setiosflags(ios::showpoint) << setprecision(3);
  10. cout<< (x*y) << endl;
  11.  
  12. cout << endl << a*z;
  13. cout << endl << setprecision(0)<< a*z;
  14.  
  15. cout << int(a*z) << endl; //Usando il CASTING abbiamo il risultato che ci aspettavamo
  16.  
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement