Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<conio.h>
- #include<stdio.h>
- struct POINT
- {
- int x,y;
- };
- union POINT2
- {
- int x,y;
- };
- void main()
- {
- struct POINT P1= {2,3};
- union POINT2 P2;
- P2.x = 4;
- P2.y = 5;
- clrscr();
- printf("\nthe cordinate of P1 are x = %d And y = %d",P1.x,P1.y);
- //struct output x=2 and y=3;
- //Union Occupia Big Value Only Print Big Value
- printf("\nthe cordinate of P2 are x = %d And y = %d",P2.x,P2.y);
- //union output P2 x=5 and y=5;
- getch();
- }
Add Comment
Please, Sign In to add comment