Question 1 10 pts Directions: Write fully executable code when answering the fol
ID: 3751116 • Letter: Q
Question
Question 1 10 pts Directions: Write fully executable code when answering the following question. For the following question you may assume you can use functions from stdio.h and math h 1. Declare 1 character variable initial 2. Declare 3 integer variables initial,code, result, and number 3. Write the 4 statements needed to prompt for input and "read from the keyboard and store a value in initial and in number 4. Write the statement to assign the numerical ASCIl value of initial to initial code 5. Write the statement to assign the absolute value of initial_code minus number to the variable result HTML Editor o words MacBook Air 000a F4 FS F6 F7 F9 F3Explanation / Answer
// 1 char initial; // 2 int initial_code, result, number; // 3 printf("Enter initial: "); scanf(" %c", &initial); printf("Enter number: "); scanf("%d", &number); // 4 initial_code = (int) initial; // 5 result = abs(initial_code - number);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.