not really but i have to follow specific format for the input for my assignment which my code doesn't for example if 15 is inserted by user then the output will be $15.00 and 1000 out put will be invalid
Or you could use some of the manipulators provided in <iomanip> along with things like std::fixed() and std::setprecision() so you can display 15 as 15.00 preceded by a '$' character.