Sunday, 11 December 2011

Write a program to print that all members of union storage location is one in c

#include
union math
{
int a,b;
}value;
void main()
{
clrscr();
printf("\n Enter Numer-A-:");
scanf("%d",&value.a);
printf("Firsst Time Value of A is:%d\n",value.a);
printf("\n Enter Number-B-:");
scanf("5d",&value.b);
printf("Now Value of A is:%d\nand Value of B is:%d",value.a,value.b);
getch();
}
OUTPUT
Enter number-A-:4
First Time Value of A is :4
Enter Number-B-:Now Value of A is :7
And Value of B is :7

No comments:

Post a Comment