Virajsinh

B_PRM_13

Nov 3rd, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<conio.h>
  2. #include<stdio.h>
  3.  
  4. struct POINT
  5. {
  6. int x,y;
  7. };
  8.  
  9. union POINT2
  10. {
  11. int x,y;
  12. };
  13.  
  14. void main()
  15. {
  16. struct POINT P1= {2,3};
  17. union POINT2 P2;
  18. P2.x = 4;
  19. P2.y = 5;
  20. clrscr();
  21.  
  22. printf("\nthe cordinate of P1 are x = %d And y = %d",P1.x,P1.y);
  23. //struct output x=2 and y=3;
  24. //Union Occupia Big Value Only Print Big Value
  25. printf("\nthe cordinate of P2 are x = %d And y = %d",P2.x,P2.y);
  26. //union output P2 x=5 and y=5;
  27. getch();
  28.  
  29. }
Add Comment
Please, Sign In to add comment