C Programming - Memory Allocation

1.
Point out the error in the following program.
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int *a[3];
    a = (int*) malloc(sizeof(int)*3);
    free(a);
    return 0;
}
Error: unable to allocate memory
Error: We cannot store address of allocated memory in a
Error: unable to free memory
No error
Answer: Option
Explanation:
We should store the address in a[i]

2.
Point out the error in the following program.
#include<stdio.h>
#include<stdlib.h>

int main()
{
    char *ptr;
    *ptr = (char)malloc(30);
    strcpy(ptr, "RAM");
    printf("%s", ptr);
    free(ptr);
    return 0;
}
Error: in strcpy() statement.
Error: in *ptr = (char)malloc(30);
Error: in free(ptr);
No error
Answer: Option
Explanation:
Answer: ptr = (char*)malloc(30);