The following program has careless errors on several lines. Find and correct the errors, show a diagram of the execution (cross things out that are no longer valid), and show the output where requested.
#include <stdio.h>
int main()
{
int *ptr;
int *temp;
int x;
ptr = (int *) malloc(sizeof(int));
*ptr = 4;
*temp = *ptr;
printf("%p %p", ptr, temp);
x = 9;
*temp = x;
printf("%d %d", *ptr, *temp);
ptr = (int *) malloc(sizeof(int));
ptr = 5;
printf("%d %d", *ptr, *temp); // Output: ________________
}