How can i take a float value and print it as it is in c++(5.0 as 5.0) : In one problem i am receiving such inputs and i need to output them as it is.<br>
For example i will receive 5.0 as input and need to print 5.0 as output,<br>
but <b>it is printing 5</b> i used <b>setprecision but is not working</b> .<br>
I think the thing is 
<u>for numbers like 2.0,3.0,4.0 it is rounding off while taking input itself</u>. 
Please help me.


See my code:

    float n=5.0

    //	n*=1.0;
	cin>>n;
	cout<<setprecision(16);
	cout<<n;//its printing 5 here 
    
    
    
<pre>
    
	
</pre>

  

/*
i also tried<br>
printf("%f",n);<br>
//but its printing 5.000000<br>
i can't use printf("%.1f",n)<br>
as input can be 5.234 or 4.5687 so making %.1f will not work for others<br>


*/
