0% found this document useful (0 votes)
16 views

Include

The document defines a C program that uses a nested struct to store employee data including number, name, department, designation, and salary. The program prompts the user to input these fields, stores them in the struct variable ep1, and then prints out the stored values.

Uploaded by

sathyadhoni
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Include

The document defines a C program that uses a nested struct to store employee data including number, name, department, designation, and salary. The program prompts the user to input these fields, stores them in the struct variable ep1, and then prints out the stored values.

Uploaded by

sathyadhoni
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

ROLLNO:709409

PROGRAM:

#include<stdio.h>
#include<conio.h>
struct employee
{
int eno;
char ename[25];
struct personal
{
char dept[15];
char desig[10];
int salary;
}e1;
};
void main()
{
struct employee ep1;
printf("\n enter employee no");
scanf ("%d",&ep1.eno);
printf("\n enter name");
scanf("%s",ep1.ename);
printf("\n enter department");
scanf("%s",ep1.e1.dept);
printf("\n enter designation");
scanf("%s",ep1.e1.desig);
printf("\n enter salary");
scanf("%d",&ep1.e1.salary);
printf("\n employee no=%d",ep1.eno);
printf("\n department name=%s",ep1.ename);
printf("\n designation=%s",ep1.e1.desig);
printf("\n salary=%d",ep1.e1.salary);
getch();
}
OUTPUT:

enter employee no101

enter name selvam

enter department computer

enter designation manager

enter salary 15000

employee no=101
department name=selvam
designation=manager
salary=15000

You might also like