Virajsinh

B_PRM_02

Oct 9th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. /* Write a Program assign one structure variable to another structure */
  2.  
  3. #include<stdio.h>
  4. #include<conio.h>
  5.  
  6. struct student
  7. {
  8.     int roll;
  9.     char name[15], add[15], city[15];
  10. };
  11.  
  12.  
  13. void main()
  14. {
  15.     struct student i,j;
  16.     clrscr();
  17.  
  18.     printf("Ente Roll :");
  19.     scanf("%d", &i.roll);
  20.     printf("Enter Name :");
  21.     scanf("%s",i.name);
  22.     printf("Enter Address :");
  23.     scanf("%s",i.add);
  24.     printf("Enter City :");
  25.     scanf("%s",i.city);
  26.  
  27.     j=i;
  28.  
  29.     printf("\n Roll : %d",i.roll);
  30.     printf("\n Name : %s",i.name);
  31.     printf("\n Address : %s",i.add);
  32.     printf("\n City : %s",i.city);
  33.  
  34.     printf("\n\n Store One Struct To Another Struct");
  35.     printf("\n\n Roll : %d",j.roll);
  36.     printf("\n Name : %s",j.name);
  37.     printf("\n Address : %s",j.add);
  38.     printf("\n City : %s",j.city);
  39.  
  40.  
  41.     getch();
  42. }
Add Comment
Please, Sign In to add comment