Program untuk merepresentasikan bilangan bulat menjadi bilangan scientific


#include <iostream>
#include <cstdlib>
using namespace std;

int main(int argc, char** argv) {
    double a,b,c;
    
      a = 12.3141592654;
      b = 2004.0;
      c = 1.23E1;
      
      cout.precision(4);
      cout<<a<<"\t"<<b<<"\t"<<c<<endl;
      cout<<fixed<<a<<"\t"<<b<<"\t"<<c<<endl;
      cout<<scientific<<a<<"\t"<<b<<"\t"<<c<<endl;
    
    return 0;
}

Comments