hi there can anyone help me with this. i found this program on the internet and have changed it a bit to suit my needs. but the final step I'm caught with is multiplying my final value by 9.
at this stage my program will separate hole numbers from decimals. it will multiply the hole number by 0, this is cancelling it out and leaving me with only the decimals, but i am struggling to multiply my final value by 9. any help is greatly appreciated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
#include <iomanip>
int main()
{
printf("enter number");
float f=1;
while (f)
{
std::cin >> f;
int i = (int)f;
std::cout << i*0<< std::setprecision(3) << f - i << std::endl;
}
return 0;
}