/ * program to print the values of structure members */
Employee
{
name[15];
empid;
salary;
};
main()
{
Employee emp1={"Nitish",2092,2000};
Employee emp2,emp3;
strcpy=(emp2.name,"gaurav");
emp2.empid=890;
emp2.salary=10000;
printf("Enter the name Empid and salary: ");
scanf("%s %d %f \n",&emp3.name,&emp3.empid,&emp3.salary);
printf("emp1: %s %d %f \n",emp1.name,emp1.empid,emp1.salary);
printf("emp2: %s %d %f \n",emp2.name,emp2.empid,emp2.salary);
printf("emp3: %s %d %f \n",emp3.name,emp3.empid,emp3.salary);
return 0;
}
|