Answers

Question and Answer:

  Home  Search Pattern

⟩ 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

a) it will print nothing

Explanation:

none.

Output:

[root@localhost google]# gcc -o san san.c

[root@localhost google]# ./san

#include

#include

int main()

{

int fd, count;

char ch;

fd = open("san.c",O_RDONLY);

do{

count = read(fd,&ch,1);

printf("%c",ch);

}while(count);

}

[root@localhost google]#

 154 views

More Questions for you: