Question: please do code based off three images Write a C program that asks the user to enter three numbers (integres). A menu wl be displayed

 please do code based off three images Write a C programthat asks the user to enter three numbers (integres). A menu wlbe displayed to let the user choose one of the three options:

please do code based off three images

Write a C program that asks the user to enter three numbers (integres). A menu wl be displayed to let the user choose one of the three options: show the sum of the two highest numbers, product of the three numbers or the largest of the three numbers. See the sample runs. Required: Your code must use pointers ONLY! Consequently, the function malloc should be used to allocate memory spaces for the user's input and possibly for other data. Hint: Can you tell what does this code do (answer this without putting the code in the computer first)? As you can see, only pointers are used. #include #include int main () int *pointer1, *pointer2; char option; pointerlmalloc ( sizeof (int) ); pointer2- malloc (sizeof (int) option - malloc ( sizeof (char)) *option = 'Y' ; while ( *option-' y ' | | * option- 'Y ') printf (" Enter two numbers :"); scanf ("%d2d", pointe r 1, pointer2 ) ; // no & in this scanf. Why? printf printf ("%d ("%d %d= %d= %d ", %d ", *pointe r1, *pointe r1, *pointer2, *pointer2 , *pointer! *pointer! *pointer2); *pointer2 ); + + x * printf ("Do it again? y/Y or n/N: "); scanf (" %c", option); while *option != 'y' && *option != 'Y' && *option != 'n' && *option != 'N' y/Y n/N: printf ("Invalid option. scanf (" %c", option); Try again or "); return 0

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