Given the code snippet, shown in the image, match the C statements below with the
correct description.
char val = 'a';
FILE *fptr = NULL;
fileptr = fopen("binfile",
"wb+");
fclose(fileptr);
{
if(fileptr == NULL)
{
printf("Nope!!!\n");
exit(-1);
}
}
fread(&val, 4, 1, fileptr);
fileptr = fopen("binfile",
"r+");
1. Close a file
2. Read the contents of a binary file.
3. Open a file for reading and writing
4. Open a file for writing and reading
in binary mode
5. Test if file opened properly