ExamVeda
Login
Home
11
What is the output of this program?
#!/bin/bash
var[1]=hello_1
var[2]=hello_2
var[3]=hello_3
echo ${var[*]}
exit 0
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
12
The command "gcc -S demo.c" will
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
13
The statement z = 'expr 5 / 2' would store which of the following values in z?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
14
This program will create . . . . . . . . child processes?
#include<stdio.h>
#include<unistd.h>
 
int main()
{
    fork();
    fork();
    fork();
    printf("Example\n");
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
15
The COFF stands for
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
16
The kill system call is used to
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
17
Which GDB command interrupts the program whenever the value of a variable is modified and prints the value old and new values of the variable?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
18
What is the output of second program if we run the demo1 first and after that we run demo2 in the different terminal?
/*This is demo1.c*/
#include<stdio.h>
#include<sys/ipc.h>
#include<sys/shm.h>
#include<string.h>
 
int main()
{
    int shm_id;
    char *addr;
    struct shmid_ds ds;
    shm_id = shmget((key_t)1234,10,0666|IPC_CREAT);
    if(shm_id == -1){
        perror("shmget");
    }
    addr = (char*)shmat(shm_id,NULL,SHM_RND);
    if(addr == (char *)-1){
        perror("shmat");
    }
    strcpy(addr,"Example");
    if (shmdt(addr) != 0){
        perror("shmdt");
    }
    sleep(10);      
    if( shmctl(shm_id,IPC_RMID,0) == -1){
        perror("shmctl");
    }
    return 0;
}
/*This is demo2.c*/
#include<stdio.h>
#include<sys/ipc.h>
#include<sys/shm.h>
 
int main()
{
    int shm_id;
    char *addr;
    struct shmid_ds ds;
    shm_id = shmget((key_t)111,10,0666|IPC_CREAT);
    if(shm_id == -1){
        perror("shmget");
    } 
    addr = (char*)shmat(shm_id,NULL,SHM_RND);
    if(addr == (char *)-1){
        perror("shmat");
    } 
    printf("%s\n",addr);
    if (shmdt(addr) != 0){
        perror("shmdt");
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
The result of an expression can be assigned to an environement variable with the command
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
20
Kernel modules are present in
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board