Structure Programming in C


                    Structure is the collection of the variable of different datatypes under same which is easy to handling. for example consider the sample of getting the employee name and no as input and display the same as output.

Syntax for the Structure

struct structure_name
   datatype variable_name1:
   datatype variable_name2;
   datatype variable_name n;

Sample Structure program for employee details

struct employee 
   int emp_no;
   char emp_name[20];
void main()
   printf(“enter employee name”);
   printf(“Enter employee number”);
   printf(“Name of the employee is %s :”,e.emp_name);
   printf(“Number of the employee is %d :”,e.emp_no);
this is the sample program structure with pointer object will be the next post.
hope this will help you.

Tell us Your Suggestion

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s