Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1: 1) Write a C program getPhoneNumber.c that accepts a phone number from the user in the form XXX-XXX-XXXX, and then displays it in
Part 1: 1) Write a C program getPhoneNumber.c that accepts a phone number from the user in the form XXX-XXX-XXXX, and then displays it in the form (XXX)XXX-XXXX: Enter a date (XXX-XXX-XXXX) 011-123-4567 You entered (011) 123-456 Question: Execute your getPhoneNumber.c and attach a screenshot of the output. Then write the source code of getPhoneNumber.c in your answer sheet and upload your file getPhoneNumber.c to iCollege. 2) Suppose that we call scanf as follows: Question: If the user enters 12.1 5.65 789 What will be the values of i, x and y after the call? (Assume that x and y are float variables and i is an int variable.) And explain why? Put your answer in the answer sheet. 3) Suppose that we call scanf as follows: scan f (ngd%f%d", &i, &x, &j); Question: If the user enters 10.2 86 What will be the values of i, x and j after the call? (Assume that i and j are int variables and x is a float variable.) And explain why? Put your answer in the answer sheet. Part 2: (Optional) Note: This part is not for grading. But your TA will give you some feedback. Can you write a shell script to finish the same task as in question 1) of Part 1? Part 1: 1) Write a C program getPhoneNumber.c that accepts a phone number from the user in the form XXX-XXX-XXXX, and then displays it in the form (XXX)XXX-XXXX: Enter a date (XXX-XXX-XXXX) 011-123-4567 You entered (011) 123-456 Question: Execute your getPhoneNumber.c and attach a screenshot of the output. Then write the source code of getPhoneNumber.c in your answer sheet and upload your file getPhoneNumber.c to iCollege. 2) Suppose that we call scanf as follows: Question: If the user enters 12.1 5.65 789 What will be the values of i, x and y after the call? (Assume that x and y are float variables and i is an int variable.) And explain why? Put your answer in the answer sheet. 3) Suppose that we call scanf as follows: scan f (ngd%f%d", &i, &x, &j); Question: If the user enters 10.2 86 What will be the values of i, x and j after the call? (Assume that i and j are int variables and x is a float variable.) And explain why? Put your answer in the answer sheet. Part 2: (Optional) Note: This part is not for grading. But your TA will give you some feedback. Can you write a shell script to finish the same task as in question 1) of
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started