Tuesday, 22 October 2013

MCA 104: COMPUTER ORGANIZATION Syllabus

MCA 104: COMPUTER ORGANIZATION

UNIT I: Logic Circuits: Logic functions synthesis of logic functions – Minimizations of logic - Synthesis with NAND and NOR gates Implementation of Logic gates -  Flip-flops Registers and shift registers counters – decoders Multiplexesrs PLDs – sequential circuits.  Basic Structure of Computers: Functional Units - Basic operational concepts Bus structures – performance Multiprocewessors and Multi computers: Functional Units Basic operational concepts – Bus structures performance Multiprocessors and Multicomputers Historical Perspective.

UNIT II: Machine Instructions and programs: Numbers, Arithmetic operations and characters

Memory locations and address, operations – instructions and instruction, sequencing – addressing modes   - assembly language basic input/output operations subroutines – encoding of Machine instructions Instructions Assembly language –O/I operations – Registers and addressing – Instructions language – program flow control – I/O operations logic instructions of 6300 and Intel Pentium.

UNIT III: Input / Output organization: accessing I/O Devices – Interrupts – direct memory access – buses 240-interface circuits Standard I/O Interfaces.

UNIT IV: Memory System, Concepts – semiconductor RAM memorie - Resdonly memories –cache memories performance considerations virtual  memories management requirements– secondary storage Arithmetic: Addition and subtraction of signel members – design of fast adders  –  multiplication  of  positive  members  –  signed  operand  multiplication  –  fast multiplication – integer division – floating point numbers and operations.

UNIT V: Basic Processing Unit: Concepts execution of a complete instruction Multiple – Bus organization hardware control – microprogrammed control.  Pipelining: Concepts Data hazards instruction hazards influence on Instruction sets  data path and control constructions – supers cal operation- ultra SPARC II – Performance considerations.
Text Books:  Hamacher C, Vranesic Z, and Zaky S. Computer Organization, 5th  edition, McGraw – Hill, 2002.

Reference Books:

1.  Stallings W, Computer Organization and Architecture, 6th  edition. Parson Education,2003.

2.  Mano M.M. Computer System Architecture, 3rd edition. PHI, 1993.

3.  Yarbrough JM, Digital Logic – Applications and Design, Thomas Lernig, 1997.

4.  Heuring VP,  and  Jordan HF, Computer Systems Design and Architecture, Pearson Education, 1997.


Tuesday, 25 June 2013

M.Tech---Advance Computer Networks


ADVANCED COMPUTER NETWORKS
UNIT I
Review of Computer Networks and the Internet: What is the Internet, The Network edge, The Network core, Access Networks and Physical media, ISPs and Internet Backbones, Delay and Loss in Packet-Switched Networks, History of Computer Networking and the Internet - Foundation of Networking Protocols: 5-layer TCP/IP Model, 7-Layer OSI Model, Internet Protocols and Addressing, Equal-Sized Packets Model: ATM

UNIT II
Networking Devices: Multiplexers, Modems and Internet Access Devices, Switching and Routing Devices, Router Structure. The Link Layer and Local Area Networks: Link Layer: Introduction and Services, Error- Detection and Error-Correction techniques, Multiple Access Protocols, Link Layer Addressing, Ethernet, Interconnections: Hubs and Switches, PPP: The Point-to-Point Protocol, Link Virtualization

UNIT III
Routing and Internetworking: Network–Layer Routing, Least-Cost-Path algorithms, Non-Least-Cost-Path algorithms, Intradomain Routing Protocols, Interdomain Routing Protocols, Congestion Control at Network Layer. Logical Addressing: IPv4 Addresses, IPv6 Addresses - Internet Protocol: Internetworking, IPv4, IPv6, Transition from IPv4 to IPv6 – Multicasting Techniques and Protocols: Basic Definitions and Techniques, Intradomain Multicast Protocols, Interdomain Multicast Protocols, Node-Level Multicast algorithms

UNIT IV
Transport and End-to-End Protocols: Transport Layer, Transmission Control Protocol (TCP), User Datagram Protocol (UDP), Mobile Transport Protocols, TCP Congestion Control Application Layer: Principles of Network Applications, The Web and HTTP, File Transfer: FTP, Electronic Mail in the Internet, Domain Name System (DNS), P2P File Sharing, Socket Programming with TCP and UDP, Building a Simple Web Server

UNIT V
Wireless Networks and Mobile IP: Infrastructure of Wireless Networks, Wireless LAN Technologies, IEEE 802.11 Wireless Standard, Cellular Networks, Mobile IP, Wireless Mesh Networks (WMNs)

UNIT VI
Optical Networks and WDM Systems: Overview of Optical Networks, Basic Optical Networking Devices, Large-Scale Optical Switches, Optical Routers, Wavelength Allocation in Networks, Case Study: An All- Optical Switch

UNIT VII
VPNs, Tunneling and Overlay Networks: Virtual Private Networks (VPNs), Multiprotocol Label
Switching (MPLS), Overlay Networks – VoIP and Multimedia Networking: Overview of IP Telephony, VoIP Signaling Protocols, Real-Time Media Transport Protocols, Distributed Multimedia Networking, Stream Control Transmission Protocol

UNIT VIII
Mobile A-Hoc Networks: Overview of Wireless Ad-Hoc Networks, Routing in Ad-Hoc Networks, Routing Protocols for Ad-Hoc Networks – Wireless Sensor Networks: Sensor Networks and Protocol Structures, Communication Energy Model, Clustering Protocols, Routing Protocols

TEXT BOOKS:
1. Computer Networking: A Top-Down Approach Featuring the Internet, James F. Kurose, Keith W.Ross, Third Edition, Pearson Education, 2007
2. Computer and Communication Networks, Nader F. Mir, Pearson Education, 2007

REFERENCE BOOKS:
1. Data Communications and Networking, Behrouz A. Forouzan, Fourth Edition, Tata McGraw
Hill, 2007
2. Guide to Networking Essentials, Greg Tomsho,Ed Tittel, David Johnson,Fifth Edition, Thomson.
3. An Engineering Approach to Computer Networking , S.Keshav, Pearson Education.
4. Campus Network Design Fundamentals, Diane Teare, Catherine Paquet, Pearson
Education (CISCO Press)
5. Computer Networks, Andrew S. Tanenbaum, Fourth Edition, Prentice Hall.
6. The Internet and Its Protocols,A.Farrel,Elsevier.

Friday, 22 February 2013

12. Write a program to create two pipes.

/*
 *  pipes.c
 * 
 *  A set of processes randomly messaging each the other, with pipes.
 *
*/

/* ... */
#include
/* for read() and write() */
#include
#include
/* for strlen and others */
#include
/* for pipe() */
#include
/* for [s]random() */
#include
/* for time() [seeding srandom()] */
#include

Wednesday, 20 February 2013

Program:To write a c program to create a message queue with read and write permissions to write 3 messages to it with different priority numbers.

/*

Program:To write a c program to create a message queue with read and write permissions to write
        3 messages to it with different priority numbers.

        
*/

    //receiver.c
  #include
#include
#include
main()
{
int msqid,t;
int key,r;
struct mymsg
{
long type;
char mtext[512];
}msg;
key=ftok("arth.sh",78);
printf("Enter the type of the message :\n");
scanf("%ld",&msg.type);
msqid=msgget(key,IPC_CREAT|0666);
r=msgrcv(msqid,&msg,sizeof(msg),msg.type,IPC_NOWAIT);
if(r==-1)
{
printf("Message received failed\n");
}
else
{
printf("Message received successively\n");
printf("Message = %s",msg.mtext);
}
}

~

/*-------------------------------------INPUT/OUTPUT--------------------------
-bash-3.2$ cc receiver_msgqq.c
-bash-3.2$ ./a.out
Enter the type of the message :
hello
Message received successively



-bash-3.2$ ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

------ Semaphore Arrays --------
key        semid      owner      perms      nsems

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0x070006ed 0          09121f0007 666        0            0
0x640011f2 32769      09121f0007 666        0            0
0xf40011f2 65538      09121f0007 666        1560         3
0x0e001c23 98307      09121f0004 666        336          3
0x070011f2 131076     09121f0007 666        0            0
0x09001a8e 163845     09121f0009 666        0            0
0x090008f2 196614     09121f0009 666        0            0
0x00000100 229383     09121f0044 666        3640         7
0x4e000410 262152     09121f0078 666        1040         2


-------------------------------------------------------------------------*/

Program:To write a C program that illustrates communication between unrelated processes using named pipe.

/*
 Program:To write a C program that illustrates communication between unrelated
        processes using named pipe.

*/

   //sender.c
  #include
   #include
   #include
   #include
   #include
   #include
   main()
   {
           int fd,p;
          char *msg="Hello Named Pipe";
          p=mknod("/tmp/mansoorpipe",S_IFIFO | 0666,0);
          if(p==-1)
          {
                  printf("\n Names Pipe failure\n ");
                  return;
          }
          fd=open("/tmp/mansoorpipe",O_WRONLY);
          if(fd<0 br="">          {
                  printf("\n File Opening Problem\n ");
                  _exit(0);
          }
          write(fd,msg,strlen(msg)+1);


//reciever.c



 1 #include
  2 #include
  3 #include
  4 #include
  5 #include
  6 main()
  7 {
  8         char buf[100];
  9         int fd,i;
 10         fd=open("/tmp/mansoorpipe",O_RDONLY);
 11         if(fd<0 br=""> 12         {
 13                 printf("File Opening Problem");
 14                 return;
 15         }
 16         i=read(fd,buf,100);
 17         buf[i]='\0';
 18         printf("%s",buf);
 19         close(fd);
 20 }




/*--------------------INPUT/OUTPUT--------------------

-bash-3.2$ cc sender.c -o sender
-bash-3.2$ cc reciever.c -o reciever
hello named pipe
-bash-3.2$ cat fact.c > /tmp/mansoorpipe
 cat < /tmp/mansoorpipe facts


--------------------------------------------------------*/                                  

Program:To implement in c the following unix commands using system calls 1.mv

/*

Program:To implement in c the following unix commands using  system calls
         1.mv       

*/
 


#include
#include
#include
#include
#include
#include
main(int argc,char *argv[])
{
int fd1,fd2;
char ch;
fd1=open(argv[1],O_RDONLY,0666);
fd2=open(argv[2],O_CREAT | O_WRONLY,0666);
if(fd1<0 br="" fd2="">{
printf("File opening problem");
return;
}
while(1)
{
if(read(fd1,&ch,1)<=0)
break;
write(fd2,&ch,1);
}
unlink(argv[1]);
close(fd1);
close(fd2);
printf("\n File renamed successfully\n");
}




/*----------------------------INPUT/OUTPUT-------------------
-bash-3.2$ cc mymv.c -o mymv

-bash-3.2$ ./mymv hello.c helloworld.c

 File renamed successfully


-------------------------------------------------------------*/       

Program:To write a C program to simulate the unix ls -l command.

/*

Program:To write a C program to simulate the unix ls -l command.

*/

      #include
      #include
      #include
       #include
      #include
      main(int argc,char *v[])
      {
          DIR *dp;
          struct dirent *p;
          struct stat buf;
          if(argc!=2)
          {
                  printf("\n Insufficient args:");
                 return;
          }
          dp=opendir(".");
          if(dp==NULL)
          {
                  printf("Directory opening problem");
                  return;
          }
          while((p=readdir(dp))!=NULL)
          {
                  if(stat(p->d_name(&buf))<0 br="">                  {
                          printf("\nStat error");
                          exit(0);
                  }
                  if(S_ISREG(buf.st_mode))
                          printf("_");
                  if(S_ISDIR(buf.st_mode))
                          printf("d");
                  if(S_ISCHR(buf.st_mode))
                          printf("c");
                  if(S_ISBLK(buf.st_mode))
                          printf("b");
                  if(S_ISFIFO(buf.st_mode))
                          printf("p");
                  if(S_ISLNK(buf.st_mode))
                          printf("l");
                  if(S_ISSOCK(buf.st_mode))
                          printf("s");
                  if(S_IRUSR & buf.st_mode)
                        printf("r");
                 else
                          printf("-");
                  if(S_IWUSR & buf.st_mode)
                          printf("w");
                 else
                          printf("-");
                 if(S_IXUSR & buf.st_mode)
                          printf("x");
                 else
                         printf("-");
                  if(S_IRGRP & buf.st_mode)
                          printf("x");
                  else
                          printf("-");
                  if(S_IWGRP & buf.st_mode)
                          printf("w");
                  else
                          printf("-");
                  if(S_IXGRP & buf.st_mode)
                          printf("x");
                  else
                          printf("-");
                  if(S_IROTH & buf.st_mode)
                          printf("r");
                  else
                         printf("-");
                  if(S_IWOTH & buf.st_mode)
                         printf("w");
                  else
                          printf("-");
                  if(S_IXOTH & buf.st_mode)
                          printf("x");
                  else
                          printf("-");
                  printf("%d",buf.st_nlink);
                  printf("%d",buf.st_uid);
                  printf("%d",buf.st_gid);
                  printf("%d",buf.st_size);
                  printf("%ld",buf.st_ctime);
                  printf("%s\n",p->d_name);
          }
      }

/*-------------------------------INPUT/OUTPUT---------------------------

-bash-3.2$ cc mylsll.c -o mylsll
-bash-3.2$ ./mylsll
total 640
-rw-r--r-- 1 09121f0078 09121f0001    3 Sep 27 15:57 3q
-rwxr-xr-x 1 09121f0078 09121f0001 7331 Dec  7 16:15 a.out
-rw-r--r-- 1 09121f0078 09121f0001  285 Sep 27 14:19 arth.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov  1 15:37 c
-rw-r--r-- 1 09121f0078 09121f0001   88 Sep 27 15:57 char
-rwxr-xr-x 1 09121f0078 09121f0001 7479 Nov 27 08:45 copy
-rw-r--r-- 1 09121f0078 09121f0001  385 Nov 27 08:50 copy.c
-rw-r--r-- 1 09121f0078 09121f0001  309 Dec  7 16:28 countawk.sh
-rw-r--r-- 1 09121f0078 09121f0001  209 Dec  7 15:46 count.sh
----r-x--T 1 09121f0078 09121f0001   27 Nov 27 15:39 cp.c
-rwxr-xr-x 1 09121f0078 09121f0001  192 Nov  1 15:06 delete.sh
-rw-r--r-- 1 09121f0078 09121f0001  231 Oct 11 16:41 directory.sh
-rw-r--r-- 1 09121f0078 09121f0001  231 Nov  1 16:04 display.sh
-rw-r--r-- 1 09121f0078 09121f0001   43 Dec  6 15:44 ex1.sh
-rw-r--r-- 1 09121f0078 09121f0001   14 Nov  1 16:30 ex1.txt
-rw-r--r-- 1 09121f0078 09121f0001   23 Nov  1 16:31 ex2.txt
-rw-r--r-- 1 09121f0078 09121f0001   63 Oct 11 14:34 example1.txt
-rw-r--r-- 1 09121f0078 09121f0001   57 Oct 11 14:29 example.txt
-rw-r--r-- 1 09121f0078 09121f0001   25 Dec  6 15:16 ex.sh
-rw-r--r-- 1 09121f0078 09121f0001   40 Dec  7 16:31 f1.c
--wxr-x--T 1 09121f0078 09121f0001   27 Nov 27 15:35 f3.c
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 16:07 f4.c
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 16:07 f5.c
-rw-r--r-- 1 09121f0078 09121f0001  146 Dec  7 16:36 factorial.ch
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 15:53 factorial.sh
-rw-r--r-- 1 09121f0078 09121f0001   24 Dec  6 16:13 ff
-rw-r--r-- 1 09121f0078 09121f0001  323 Dec  7 15:06 fib.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 16:19 file1.c
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 16:19 file2.c
-rw-r--r-- 1 09121f0078 09121f0001    0 Nov 27 16:19 file3.c
-rw-r--r-- 1 09121f0078 09121f0001   27 Dec  7 15:05 helloworld.c
-rwxr-xr-x 1 09121f0078 09121f0001 7368 Dec  6 16:32 inode
-rw-r--r-- 1 09121f0078 09121f0001  391 Dec  7 15:34 inode.c
-rw-r--r-- 1 09121f0078 09121f0001  391 Dec  6 14:58 inodes.c
-rw-r--r-- 1 09121f0078 09121f0001  292 Dec  7 15:20 line.sh
drwxr-xr-x 2 09121f0078 09121f0001 4096 Nov  1 16:23 linux
-rw-r--r-- 1 09121f0078 09121f0001  211 Nov  1 16:26 listdir.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Dec  9 08:25 lsll.c
drwxr-xr-x 2 09121f0078 09121f0001 4096 Nov 27 16:22 lunix
-rw-r--r-- 1 09121f0078 09121f0001    3 Sep 27 15:58 man
-rw-r--r-- 1 09121f0078 09121f0001    3 Sep 27 15:59 man.sh
-rw-r--r-- 1 09121f0078 09121f0001   78 Nov  1 15:10 mansoor.txt
-rw-r--r-- 1 09121f0078 09121f0001 4466 Dec  7 15:26 middle.sh
-rwxr-xr-x 1 09121f0078 09121f0001 7580 Nov 25 10:40 mycat
-rwxr-xr-x 1 09121f0078 09121f0001 7300 Nov 27 08:25 mycat1
-rw-r--r-- 1 09121f0078 09121f0001  300 Dec  7 15:27 mycat1.c
-rw-r--r-- 1 09121f0078 09121f0001  327 Nov 27 08:24 mycat.c
-rwxr-xr-x 1 09121f0078 09121f0001 7408 Nov 27 15:39 mycp
-rw-r--r-- 1 09121f0078 09121f0001  471 Nov 27 15:42 mycp.c
-rwxr-xr-x 1 09121f0078 09121f0001 7176 Dec  6 15:29 myls
-rw-r--r-- 1 09121f0078 09121f0001  287 Dec  6 15:29 myls.c
-rw-r--r-- 1 09121f0078 09121f0001 2699 Dec  7 15:01 mylsl.c
-rw-r--r-- 1 09121f0078 09121f0001 1678 Dec  9 08:28 mylsll.c
-rwxr-xr-x 1 09121f0078 09121f0001 7680 Nov 27 15:52 mymv
-rw-r--r-- 1 09121f0078 09121f0001  483 Dec  6 16:22 mymv.c
-rwxr-xr-x 1 09121f0078 09121f0001 8045 Dec  7 14:06 mypipe
-rw-r--r-- 1 09121f0078 09121f0001  748 Dec  7 16:24 mypipe.c
-rwxrwxrwx 1 09121f0078 09121f0001   86 Sep 27 14:44 number.sh
-rw-r--r-- 1 09121f0078 09121f0001  348 Dec  7 16:15 orphan.c
-rw-r--r-- 1 09121f0078 09121f0001  239 Nov 25 08:49 pc.c
-rwxrwxrwx 1 09121f0078 09121f0001  513 Dec  7 14:58 permission.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Sep 27 16:18 range.af
-rwxr-xr-x 1 09121f0078 09121f0001  148 Oct 11 14:26 range.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Dec  7 16:11 receiver.c
-rwxr-xr-x 1 09121f0078 09121f0001 7187 Dec  6 16:28 reciever
-rw-r--r-- 1 09121f0078 09121f0001  301 Dec  7 16:14 reciever.c
-rwxr-xr-x 1 09121f0078 09121f0001 7555 Dec  6 16:21 redirect1
-rw-r--r-- 1 09121f0078 09121f0001  387 Dec  7 15:58 redirect1.c
-rw-r--r-- 1 09121f0078 09121f0001  585 Dec  7 16:30 redirect.c
-rw-r--r-- 1 09121f0078 09121f0001  155 Sep 27 14:19 sample.sh
-rwxr-xr-x 1 09121f0078 09121f0001   20 Sep 27 14:19 sam.sh
-rwxr-xr-x 1 09121f0078 09121f0001 7681 Dec  6 16:28 sender
-rw-r--r-- 1 09121f0078 09121f0001  433 Dec  7 16:38 sender.c
-rw-r--r-- 1 09121f0078 09121f0001   25 Dec  6 16:43 sor
-rwxrwxrwx 1 09121f0078 09121f0001  569 Oct 11 13:57 switch.sh
drwxr-xr-x 2 09121f0078 09121f0001 4096 Nov 27 16:07 unix
-rw-r--r-- 1 09121f0078 09121f0001  154 Dec  7 15:22 vowelawk.sh
-rw-r--r-- 1 09121f0078 09121f0001    0 Sep 15 15:53 witch.h
-rw-r--r-- 1 09121f0078 09121f0001  349 Nov 25 08:27 zombie.c
-------------------------------------------------------------------*/

Program:To implement in c the following unix commands using system calls 1.ls

/*

Program:To implement in c the following unix commands using  system calls
         1.ls       

*/
  #include
   #include
   #include
   #include
   #include
   main(int argc,char *argv[])
   {
           DIR *dp;
           struct dirent *p;
          dp=opendir(argv[1]);
          while((p=readdir(dp))!=NULL)
          {
                  printf("\n%s",p->d_name);
                  printf(" %d",p->d_ino);
          }
          closedir(dp);
 }


/*----------------------INPUT/OUTPUT-------------

mymv.c 23794493
f3.c 23794091
sam.sh 23790637
sample.sh 23790652
range.af 23790887
man 23790875
. 23789662
mycp.c 23794414
.bash_history 23794443
middle.sh 23790680
man.sh 23790242
.viminfo 23794532
ex2.txt 23792334
mansoor.txt 23790235
display.sh 23792459
delete.sh 23791674
.swp 23790432
copy 23790777
.bash_profile 23794529
copy.c 23794460
line.sh 23792285
ex1.txt 23792579
c 23790660-vi myls.c


------------------------------------------------------*/

Program:To write a c program that makes a copy of a file using system calls

/*
 Program:To write a c program that makes a copy of a file using system calls       
        
*/ 
 #include
      #include
   #include
   #include
   main(int argc,char *argv[])
   {
           char ch;
           int fd1,fd2;
           fd1=open(argv[1],O_RDONLY);
          if(fd1<0 br="">          {
                  printf("\n File opening problem\n");
                  return;
          }
          fd2=open(argv[2],O_CREAT | O_WRONLY);
          if(fd2<0 br="">          {
                  printf("\n File openinng problem\n");
                  return;
          }
          while(1)
          {
                  if(read(fd1,&ch,1)<=0)
                          break;
                  write(fd2,&ch,1);
          }
          close(fd1);
          close(fd2);
          printf("\n File copied successfully\n");
  }


/*-----------------------INPUT/OUTPUT--------------

-bash-3.2$ cc mycp.c -o mycp
-bash-3.2$ ./mycp hello.c cp.c

 File copied successfully


--------------------------------------------------*/                                                 

Program:To implement in c the following unix commands using standard i/o and system calls 1.cat

Program:To implement in c the following unix commands using standard i/o and system calls
         1.cat


#include
#include
main(int argc,char *argv[])
{
int i;
char ch;
FILE *fp;
for(i=1;i{
fp=fopen(argv[i],"r");
if(fp==NULL)
printf("\n FILE DOES NOT EXIST");
else
{
while(!feof(fp))
{
ch=fgetc(fp);
printf("%c",ch);
}
}        fclose(fp);
printf("\n\n");
}
}




/*--------------------------INPUT/OUTPUT--------------

-bash-3.2$ vi mycat.c
-bash-3.2$ cc mycat.c -o mycat
-bash-3.2$ ./mycat hello.c
unix is a operating system

------------------------------------------------*/

Program:To write a c program to create a message queue with read and write permissions to write 3 messages to it with different priority numbers.

Program:To write a c program to create a message queue with read and write permissions to write
        3 messages to it with different priority numbers.

//receiver.c
#include
#include
#include
main()
{
int msqid,t;
int key,r;
struct mymsg
{
long type;
char mtext[512];
}msg;
key=ftok("arth.sh",78);
printf("Enter the type of the message :\n");
scanf("%ld",&msg.type);
msqid=msgget(key,IPC_CREAT|0666);
r=msgrcv(msqid,&msg,sizeof(msg),msg.type,IPC_NOWAIT);
if(r==-1)
{
printf("Message received failed\n");
}
else
{
printf("Message received successively\n");
printf("Message = %s",msg.mtext);
}
}

/*-------------------------------------INPUT/OUTPUT--------------------------
-bash-3.2$ cc receiver_msgqq.c
-bash-3.2$ ./a.out
Enter the type of the message :
hello
Message received successively



-bash-3.2$ ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

------ Semaphore Arrays --------
key        semid      owner      perms      nsems

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0x070006ed 0          09121f0007 666        0            0
0x640011f2 32769      09121f0007 666        0            0
0xf40011f2 65538      09121f0007 666        1560         3
0x0e001c23 98307      09121f0004 666        336          3
0x070011f2 131076     09121f0007 666        0            0
0x09001a8e 163845     09121f0009 666        0            0
0x090008f2 196614     09121f0009 666        0            0
0x00000100 229383     09121f0044 666        3640         7
0x4e000410 262152     09121f0078 666        1040         2


-------------------------------------------------------------------------*/