comma program

Given the code snippet of a calling function ->
Code the printWithComma () function starting here.

Two Sample Runs

Enter a number with up to 6 digits: 123456
The number with commas is: 123,456

Enter a number with up to 6 digits: 12
The number with commas is: 000,012

HINTS: ? fixed, showpoint, setprecision, fill ?
? right or left ? setw ?


int main()
{
// prototype
void printWithComma( int );

// variable
int number;

cout << " Enter a number with up to 6 digits: ";
cin >> number;

// call
printWithComma( number );

return 0;
}


Can anyone give me a clue as to what the body of this would go like this is what I have soo far..?
thanks guys...

1
2
3
4
void printWithComma (int number)
   {

   }
Print the left side, the comma, and the right side. The hints refer to standard library IO format manipulators.
Read this:
http://www.cplusplus.com/reference/ios/fixed/

you may find examples for the other hints as well
Topic archived. No new replies allowed.