Question: 3 . ( Using loop and conditional statements together operating on character variables ) Write a C program that converts the phone number having numbers

3.(Using loop and conditional statements together operating on character variables)
Write a C program that converts the phone number having numbers/letters into one having numbers only.
- Allow the user to enter a phone number. It can contain numbers, letters, and symbols (see sample inputs below).
- The program will output any number elements.
- The program will also echo a hyphen in addition to numbers.
- The program will output '?' for non-number elements.
- You will use "while" loop structure where looping is required.
Ex: If the input is: \(1-555-\) HOLIDAY
The output will be: Numbers only: 1-555-????????
If the input is: \(1-555\)-holiday
The output will be: Numbers only: 1-555-????????
If the input is: 999-9999
The output will be: Numbers only: 999-9999
If the input is: \(9876\mathrm{zywx}\%\$ \# \)
The output will be: Numbers only: 9876????
3 . ( Using loop and conditional statements

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