Q501
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
26/50
Page
Pick an option on a question to see the right answer and solution.
Q501
Open questionSelect an option to see the answer and solution.
Q502
Open questionSelect an option to see the answer and solution.
Q503
Open questionSelect an option to see the answer and solution.
Q504
Open questionSelect an option to see the answer and solution.
Q505
Open questionSelect an option to see the answer and solution.
Q506
Open questionSelect an option to see the answer and solution.
Q507
Open questionSelect an option to see the answer and solution.
Q508
Open question#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
struct data_st{
long int id;
char buff[11];
};
int main()
{
int m_id,ret;
struct data_st data1, data2;
m_id = msgget((key_t)181,0666|IPC_CREAT);
if(m_id == -1)
perror("msgget");
data1.id = 1;
strcpy(data1.buff,"Example");
if(msgsnd(m_id,&data1,11,0) == -1)
perror("msgsnd");
ret = msgrcv(m_id,&data2,11,1,0);
printf("%d\n",ret);
if(msgctl(m_id,IPC_RMID,0) != 0)
perror("msgctl");
return 0;
}Select an option to see the answer and solution.
Q509
Open questionint main()
{
fork();
fork();
fork();
if (wait(0) == -1)
printf("leaf child\n");
}Select an option to see the answer and solution.
Q510
Open question#include<stdio.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
int main()
{
int fd_client,fd, len;
struct sockaddr_in add_server;
fd_client = socket(AF_INET,SOCK_STREAM,0);
if (fd_client == -1){
perror("fd_sock");
exit(1);
}
add_server.sin_family = AF_INET;
add_server.sin_port = ntohs(4001);
add_server.sin_addr.s_addr = inet_addr("127.0.0.1");
len = sizeof(add_server);
fd = connect(fd_client,(struct sockaddr*)&add_server,len);
if(fd == -1)
perror("connect");
write(fd,"Hello\n",6);
return 0;
}Select an option to see the answer and solution.
Q511
Open question#! /usr/bin/awk -f
BEGIN {
a[1,1]=0
a[1,2]=1
a[2,1]=2
a[2,2]=3
for(i=1;i<3;i++) {
for(j=1;j<3;j++) {
print a[i,j]
}
}
}Select an option to see the answer and solution.
Q512
Open questionSelect an option to see the answer and solution.
Q513
Open questionSelect an option to see the answer and solution.
Q514
Open questionSelect an option to see the answer and solution.
Q515
Open questionSelect an option to see the answer and solution.
Q516
Open questionSelect an option to see the answer and solution.
Q517
Open question#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<sys/mman.h>
int main()
{
int s_id;
s_id = shm_open("shared_mem",O_CREAT|O_RDWR,0666);
printf("%d\n",s_id);
if(shm_unlink("shared_mem") == -1)
perror("shm_unlink");
return 0;
}Select an option to see the answer and solution.
Q518
Open questionSelect an option to see the answer and solution.
Q519
Open questionSelect an option to see the answer and solution.
Q520
Open questionSelect an option to see the answer and solution.