Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a Program assign one structure variable to another structure */
- #include<stdio.h>
- #include<conio.h>
- struct student
- {
- int roll;
- char name[15], add[15], city[15];
- };
- void main()
- {
- struct student i,j;
- clrscr();
- printf("Ente Roll :");
- scanf("%d", &i.roll);
- printf("Enter Name :");
- scanf("%s",i.name);
- printf("Enter Address :");
- scanf("%s",i.add);
- printf("Enter City :");
- scanf("%s",i.city);
- j=i;
- printf("\n Roll : %d",i.roll);
- printf("\n Name : %s",i.name);
- printf("\n Address : %s",i.add);
- printf("\n City : %s",i.city);
- printf("\n\n Store One Struct To Another Struct");
- printf("\n\n Roll : %d",j.roll);
- printf("\n Name : %s",j.name);
- printf("\n Address : %s",j.add);
- printf("\n City : %s",j.city);
- getch();
- }
Add Comment
Please, Sign In to add comment