31. After using the shared library, memory can be done free by calling
32. Command line parameters are passed by the
33. What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
exit(2);
break;
default :
wait(&status);
printf("%d\n",WEXITSTATUS(status));
break;
}
return 0;
}
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
exit(2);
break;
default :
wait(&status);
printf("%d\n",WEXITSTATUS(status));
break;
}
return 0;
}
34. What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 ;
perror("fork");
exit(1);
case 0 :
printf("%d\n",getppid());
break;
default :
printf("%d\n",getpid());
wait(&status);
break;
}
return 0;
}
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 ;
perror("fork");
exit(1);
case 0 :
printf("%d\n",getppid());
break;
default :
printf("%d\n",getpid());
wait(&status);
break;
}
return 0;
}
35. After running this program, as you press 'e', what will be the output of the program?
#!/bin/bash
echo "press 'e' to print Example"
read var
if $var=e
then
echo "Example"
else
echo "You did not press e"
fi
exit 0
#!/bin/bash
echo "press 'e' to print Example"
read var
if $var=e
then
echo "Example"
else
echo "You did not press e"
fi
exit 0
36. To print the value of a variable while debugging with GDB, . . . . . . . . command can be used.
37. With the list command, by default GDB prints the . . . . . . . . source lines.
38. Creation of hardlinks that point across partitions
39. The permission -rwxr–r– represented in octal expression will be
40. Which one of the following function is used to create a new attribute?
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.