ch19_4.cpp
Upload User: gzy2011
Upload Date: 2021-02-09
Package Size: 20k
Code Size: 0k
Development Platform:

Visual C++

  1. //ch19_4.cpp
  2. #include"iostream.h"
  3. void fn(float interest,float amount)
  4. {
  5. cout<<"RMB amount= ";
  6. cout.precision(2);  //置有效位数位2位
  7. cout<<amount;
  8. cout<<"nthe interest=";
  9. cout.precision(4);  //置有效位数位4位
  10. cout<<interest<<endl;
  11. }
  12. void main(void)
  13. {
  14. float f1=29.41560067f;
  15. float f2=12.567188f;
  16. fn(f1,f2);
  17. }