Q481
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
996
Questions
25/50
Page
Pick an option on a question to see the right answer and solution.
Q481
Open questionSelect an option to see the answer and solution.
Q482
Open questionuser1:x:1111:2222:Example:/home/user1:/bin/bash
Which among the following will print userid and home dir in the following pattern “user1:/home/user1”Select an option to see the answer and solution.
Q483
Open question[ -n $HOME ]
echo $?
[ -z $HOME ]
echo $?Select an option to see the answer and solution.
Q484
Open questionSelect an option to see the answer and solution.
Q485
Open questionSelect an option to see the answer and solution.
Q486
Open questionSelect an option to see the answer and solution.
Q487
Open questionSelect an option to see the answer and solution.
Q488
Open question#include<stdio.h>
#include<pthread.h>
#include<semaphore.h>
sem_t st;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
printf("Linux\n");
sem_post(&st);
pthread_exit("Bye");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) == -1)
perror("pthread_create");
if(sem_init(&st,0,0) != 0)
perror("sem_init");
if(sem_wait(&st) != 0)
perror("sem_wait");
printf("Example\n");
if(pthread_join(pt,&res_t) == -1)
perror("pthread_join");
if(sem_destroy(&st) != 0)
perror("sem_destroy");
return 0;
}Select an option to see the answer and solution.
Q489
Open questionSelect an option to see the answer and solution.
Q490
Open questionSelect an option to see the answer and solution.
Q491
Open questionSelect an option to see the answer and solution.
Q492
Open questionSelect an option to see the answer and solution.
Q493
Open question#include<stdio.h>
#include<signal.h>
#include<stdlib.h>
int main()
{
pid_t child;
child=fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
while(1){
printf("Child Process\n");
sleep(1);
}
break;
default :
sleep(5);
kill(child,SIGINT);
printf("The child process has been killed by the parent process\n");
break;
}
return 0;
}Select an option to see the answer and solution.
Q494
Open questionSelect an option to see the answer and solution.
Q495
Open questionSelect an option to see the answer and solution.
Q496
Open questionSelect an option to see the answer and solution.
Q497
Open question#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int*)malloc(sizeof(int)*2);
printf("%p\n",ptr);
printf("%p\n",ptr+1);
return 0;
}Select an option to see the answer and solution.
Q498
Open question#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
int main()
{
struct rlimit limit;
if(getrlimit(RLIMIT_CORE,&limit) != 0)
perror("getrlimit");
printf("%lu\n",limit.rlim_max);
return 0;
}Select an option to see the answer and solution.
Q499
Open questionSelect an option to see the answer and solution.
Q500
Open questionSelect an option to see the answer and solution.