Question: Write a program that inputs a telephone number as a string in the form (555) 555-5555. The program should use function strtok to extract the

Write a program that inputs a telephone number as a string in the form (555) 555-5555. The program should use function strtok to extract the area code as a token, the first three digits of the telephone number as a token and the last four digits of the phone number as a token. The seven digits of the phone number should be concatenated into one string. The program should convert the area-code string to int and convert the phone-number string to long. Both the area code and the phone number should be printed.

Step by Step Solution

3.40 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem we will write a C program that uses the strtok function to extract the various components of a telephone number formatted as 555 ... 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

Document Format (2 attachments)

PDF file Icon

60963ac78dbe4_26722.pdf

180 KBs PDF File

Word file Icon

60963ac78dbe4_26722.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!