91.
What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
 
int main()
{
    int fd;
    char *buff;
    buff = (char *)malloc(sizeof(char)*5);
    fd = open("example.txt",O_RDWR|O_CREAT); 
    write(fd,"Linux",5);
    read(fd,buff,5);
    printf("%s\n",buff);
}

94.
What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<string.h>                              
 
int main()
{
    int ptr;
    ptr = (int)malloc(sizeof(int)*10);
    return 0;
}

96.
What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
 
int main()
{
     int fd, fd2, ret;
     fd = open("hello.c",O_RDONLY);
     ret = close(fd2);
     printf("%d\n",ret);
}

98.
What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
 
int main()
{
    sem_t* sem_id;
    sem_id = sem_open("sem_value",O_CREAT,0666,0);
    if(sem_id == SEM_FAILED)
        perror("sem_open");
    sem_post(sem_id);
    printf("Example\n");
    if(sem_close(sem_id) == -1)
        perror("sem_close");
    return 0;
}

100.
The command "sed -n '/example/p' old.txt" will

Read More Section(Linux)

Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.