Virajsinh

B_PRM_12

Nov 3rd, 2017
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<conio.h>
  2. #include<stdio.h>
  3.  
  4. union data
  5. {
  6.     int i;
  7.     float f;
  8.     char str[20];
  9. };
  10.  
  11. void main()
  12. {
  13.     union data data;
  14.     clrscr();
  15.    
  16.     data.i=10;
  17.     printf("data.i : %d",data.i);
  18.  
  19.     data.f=22.6;
  20.     printf("\ndata.f : %f",data.f);
  21.  
  22.     stpcpy(data.str,"C Programming");
  23.     printf("\ndata.char : %s",data.str);
  24.    
  25.     getch();
  26. }
Add Comment
Please, Sign In to add comment