Question: cin a huge number as a string from the user, add commas between every 3 numbers (not the decimals), for example: string num; cout <

cin a huge number as a string from the user, add commas between every 3 numbers (not the decimals), for example:
string num;
cout<<"Enter number:";
cin>>num;
num is 12345678.910 or 2354738.2
displaying it as 12,345,678.910 or 2,354,738.2
thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!