Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<conio.h>
- #include<stdio.h>
- union data
- {
- int i;
- float f;
- char str[20];
- };
- void main()
- {
- union data data;
- clrscr();
- data.i=10;
- printf("data.i : %d",data.i);
- data.f=22.6;
- printf("\ndata.f : %f",data.f);
- stpcpy(data.str,"C Programming");
- printf("\ndata.char : %s",data.str);
- getch();
- }
Add Comment
Please, Sign In to add comment