#include<iostream.h> #include<conio.h> //-------------------------------- Str --------------------------------// struct str { int number_1; float number_2; }; //--------------------------------- uni -------------------------------// union uni { int number_1; float number_2; }; main() { clrscr(); struct str structure_element; union uni union_element; cout<<\"\\n ********** Structure Elements **********\"<<endl; cout<<\"\\t Enter the value of number_1 = \"; cin>>structure_element.number_1; cout<<\"\\t Enter the value of number_2 = \"; cin>>structure_element.number_2; cout<<\"\\n ********** Union Elements **********\"<<endl; cout<<\"\\t Enter the value of number_1 = \"; cin>>union_element.number_1; cout<<\"\\t Enter the value of number_2 = \"; cin>>union_element.number_2; getch(); clrscr(); cout<<\"\\n ********** Structure Elements **********\"<<endl; cout<<\"\\t Value of number_1 = \"; cout<<structure_element.number_1<<endl; cout<<\"\\t Value of number_2 = \"; cout<<structure_element.number_2<<endl; cout<<\"\\n ********** Union Elements **********\"<<endl; cout<<\"\\t Values of number_1 = \"; cout<<union_element.number_1<<endl; cout<<\"\\t Value of number_2 = \"; cout<<union_element.number_2<<endl; cout<<\"\\n\\n ********** Structure Elements **********\"<<endl; cout<<\"\\t Size of structure_element = \"<<sizeof(struct str)<<endl; cout<<\"\\n ********** Union Elements **********\"<<endl; cout<<\"\\t Size of union_element = \"<<sizeof(union uni)<<endl; getch(); return 0; }