C Program For An Employee Salary Using Structures

#include<stdio.h>
#include<conio.h>
type def struct
{
                int empid;
                chat name[30];des[20];qual[20];don[20];
                long int sal;
 }
                employee;
                void main()
    {
                employee e[100];
                int n,i;
                clrscr();
                printf("enter number of employees");
                scanf("%d",&n);
                for(i=0;i<n;i++)
                   {
                                printf("enter employee id number");
                                scanf("%d",&e[i].empid);
                                printf("enter name");
                                printf("enter date of birth in dd/mm/yyyy format");
                                flush all();
                                gets(e[i].dob);
                                printf("enter qualification");
                                flsuh all();
                                gets(e[i].qual);
                                printf("enter designation");
                                flush all();
                                gets(e[i].des);
                                printf("enter salary");
                                scanf("%d",&e[i].sal);
                    }
                    printf("employee details are \n");
                    for(i=0;i<n;i++)-
                    {
                                printf("employee id number is %d\n",e[i].empid);
                                printf("name:");
                                puts (e[i].name);
                                printf("\n date of birth:");
                                puts(e[i].dob);
                                printf("\n qualification:");
                                puts(e[i].qual);
                                printf("\n designation:");
                                puts(e[i].des);
                                printf("\n salary:%Ld",e[i].sal);
                     }
                   getch();
                }


Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Web Developer, Student and Mechanical Engineer. He Enjoys writing articles, Blogging, Solving Errors and Social Networking. Feel Free to let me know any of your concerns about hacking or let me know if you need any more methods on hacking anything. Enjoy Learning

No comments:

Post a Comment