51.
What is the output of this program?
#!/bin/bash
echo "Which file do you want to check"
read x
until [ -e $x ]
do 
echo "The file does not exist. Do you want to create? y/n"
read a
if [ $a = y ]; then  
touch $x
echo "Your file has been created successfully."
fi
done
echo "The file is present in this directory"
exit 0

54.
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");
    if(sem_close(sem_id) == -1)
        perror("sem_close");
    sem_wait(sem_id);
    printf("Example\n");
    return 0;
}

57.
What is the output of this program?
#include<stdio.h>
 
int main()
{
    fork();
    printf("Example\n");
    return 0;
}

Read More Section(Linux)

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