#include<stdio.h>
#include<conio.h>
#include<string.h>
struct emp
{
char n[20];
int a;
float s;
};
void main()
{
struct emp e1={"sanjay",23,4000.50}; //value to structures
struct emp e2,e3;
clrscr();
strcpy(e2.n,e1.n);
e2.a=e1.a;
e2.s=e1.s;
e3=e1; //copying in one shot
printf("\n%s\t%d\t%.2f",e3.n,e3.a,e3.s);
getche();
}
#include<conio.h>
#include<string.h>
struct emp
{
char n[20];
int a;
float s;
};
void main()
{
struct emp e1={"sanjay",23,4000.50}; //value to structures
struct emp e2,e3;
clrscr();
strcpy(e2.n,e1.n);
e2.a=e1.a;
e2.s=e1.s;
e3=e1; //copying in one shot
printf("\n%s\t%d\t%.2f",e3.n,e3.a,e3.s);
getche();
}
No comments:
Post a Comment