Question: Write a program that takes an integer input representing a fictitious 9-digit Social Security Number (SSN) and formats it with hyphens. The output should be

Write a program that takes an integer input representing a fictitious 9-digit Social Security Number (SSN) and formats it with hyphens. The output should be in the format "XXX-XX-XXXX," where "XXX" represents the first three digits, "XX" represents the next two digits, and "XXXX" represents the last four digits.

For example, if the input is 123456789, the program should output:

123-45-6789

Your program should handle inputs that are valid 9-digit Social Security Numbers, and it should format them as specified.

Constraints:

The input is an integer representing a fictitious 9-digit Social Security Number (SSN).
The input will always be a valid 9-digit SSN.
The output should be in the format "XXX-XX-XXXX," where "XXX" represents the first three digits, "XX" represents the next two digits, and "XXXX" represents the last four digits.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This question is complete and requires the writing of a basic program that handles and formats a giv... View full answer

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 Programming Questions!