Write a C program by using structure to display the information of
Employee. It includes
name of the employee, age, salary and date of joining
#include<stdio.h>
#include<string.h>
struct employee
{
char name[50];
int age;
int sal;
int joining;
}record;
int main()
{
record.age=14;
strcpy(record.name,"ram");
record.sal=1000;
record.joining=32;
printf("%s \n",record.name);
printf("%d \n",record.age);
printf("%d \n",record.sal);
printf("%d \n",record.joining);
return 0;
}

No comments:
Post a Comment