ExamVeda
Login
Home
This question belongs to Computer Science Linux
Linux
?

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
 
int main()
{
    int fd_server, fd_client, len, len_client;
    struct sockaddr_in add_server;
    fd_server = socket(AF_INET,SOCK_STREAM,0);
    fd_client = accept(fd_server,(struct sockaddr*)&add_server,&len);
    if(fd_client == -1)
        perror("accept");
    if(listen(fd_server,5) != 0)
        perror("listen");
    return 0;
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.