title: output answer by rounding off in c++
body: <p>In a programming contest i got a task to print my output this way but i couldnot figure out the correct method to do this.How can we do this in c++?Suppose my output is stored in a double  variable and i need to follow this pattern or format</p>
  
  <p>If output is supposed to be 0.0034567, output should be "3.457 3". </p>
  
  <p>If output is supposed to be 0.3034567, output should be "3.034 1".</p>