double - How to make C++ cout not use scientific notation -


double x = 1500; for(int k =0; k<10 ; k++){     double t =0;     for(int i=0; i<12; i++){         t += (double) x * 0.0675;         x += (double) x * 0.0675;     }     cout<<"bas ana: "<<x<<"\tson faiz: "<<t<<"\tson ana: "<<x+t<<endl;       } 

this output

bas ana: 3284.78 son faiz: 1784.78 son ana: 5069.55

bas ana: 7193.17 son faiz: 3908.4 son ana: 11101.6

bas ana: 15752 son faiz: 8558.8 son ana: 24310.8

bas ana: 34494.5 son faiz: 18742.5 son ana: 53237

bas ana: 75537.8 son faiz: 41043.3 son ana: 116581

bas ana: 165417 son faiz: 89878.7 son ana: 255295

bas ana: 362238 son faiz: 196821 son ana: 559059

bas ana: 793246 son faiz: 431009 son ana: 1.22426e+006

bas ana: 1.73709e+006 son faiz: 943845 son ana: 2.68094e+006

bas ana: 3.80397e+006 son faiz: 2.06688e+006 son ana: 5.87085e+006

i want numbers shown exact numbers not scientific numbers. how can this?

use std::fixed stream manipulator:

cout<<fixed<<"bas ana: "<<x<<"\tson faiz: "<<t<<"\tson ana: "<<x+t<<endl; 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -