Structure and Function

Thursday, 8 September 2011

#include<stdio.h>
#include<conio.h>


  typedef struct
   {
      int ecode;
      char ename[10];
      int esal;
   }emp;


void main()
{
emp e={1013,"Mahesh",20000};
void show(emp);
clrscr();
show(e);
getch();
}


void show(emp p)
{
  printf("\nDetails of Employee\n");
  printf("Name:\t%s\n",p.ename);
  printf("Ecode:\t%d\n",p.ecode);
  printf("Sal:\t%d\n",p.esal);
}


OUTPUT:


Detail's of Employee
Name:   Mahesh
Ecode:  1013
Sal:    20000










No comments:

Post a Comment

 

Blogger news

Blogroll

Enter your email address:

Delivered by FeedBurner

Total Pageviews

Followers

Most Reading