91. Which command prints the directory stack?
92. For debugging with GDB, the compiled program can be run by the command
93. Which one of the following is used by awk to control the conversion of numbers to string?
94. What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int *)malloc(sizeof(int));
printf("%d\n",*ptr);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int *)malloc(sizeof(int));
printf("%d\n",*ptr);
return 0;
}
95. The terminal used by a Daemon process is:
96. When a program is linked with a shared library
97. How do you print the lines between 5 and 10, both inclusive
98. In vi editor, which command reads the content of another file?
99. What is the output of this program?
#include<stdio.h>
#include<pthread.h>
sem_t st;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
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,1,2) != 0)
perror("sem_init");
if(pthread_join(pt,&res_t) == -1)
perror("pthread_join");
if(sem_destroy(&st) != 0)
perror("sem_destroy");
return 0;
}
#include<stdio.h>
#include<pthread.h>
sem_t st;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
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,1,2) != 0)
perror("sem_init");
if(pthread_join(pt,&res_t) == -1)
perror("pthread_join");
if(sem_destroy(&st) != 0)
perror("sem_destroy");
return 0;
}
100. This program will allocate the memory of . . . . . . . . bytes for pointer "ptr".
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = realloc(0,sizeof(int)*10);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = realloc(0,sizeof(int)*10);
return 0;
}
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.