Linux Search Pattern Question: Download Search Pattern PDF

Output of this program?

#include<stdio.h>
#include<fcntl.h>

int main()
{
pid_t fd;
char ch;
int count;
fd = open("san.c",O_RDONLY);
do{
count = read(fd,&ch,1);
printf("%c",ch);
}while(count);
return 0;
}
a) it will print nothing
b) it will print the source code of the source file "san.c"
c) segmentation fault
d) none of the mentioned

Tweet Share WhatsApp