-
What is the output of this program?
#include <iostream>
int main ()
{
FILE * ptr;
long size;
ptr = fopen ("Example.txt", "rb");
if (ptr == NULL)
perror ("Error opening file");
else
{
fseek (ptr, 0, SEEK_END);
size = ftell (ptr);
fclose (ptr);
printf (" %ld\n", size);
}
return 0;
}
-
- Depends upon the file
- 50
- 100
- 20
- None of these
Correct Option: A
This program will return the size of the file in bytes.