longdouble a=0,b=0;
a=20.32141646157621672176152;
cout<<fixed<<setprecision(20)<<"Round of "<<a<<" is "<<round(a,10)<<endl;
Also I tried
temp*=pow(10,-i)
It gives
203214164615.76216505467891693115
203214164616.26216505467891693115
203214164616.00000000000000000000000000000000000000000000000000
20.32141646160001127903449447131833949242718517780304
Round of 20.32141646157621650559 is 20.32141646160001127903
Ah, ok, so you want to round to a certain decimal place. It's not really a good idea to do that because many floating point values can't be stored exactly so you will get rounding errors. If you just want to show a certain number of decimals it's much better to use setprecision when printing the value.
As this is my assignment, i must have to do so!
I understand precision is only helpful in displaying the variable. But while doing operation on it it is using its actual value.