Basic structure program
#include <stdio.h>
#include<string.h>
struct employee
{
int code;
float salary;
char name[10];
};
int main(){
struct employee e1;
e1.code=100;
e1.salary=234.56;
strcpy(e1.name, "Anchal");
printf("The employee details are as follows:\nCode:%d\nSalary:%.2f\nName:%s",e1.code,e1.salary,e1.name);
return 0;
}
Comments
Post a Comment