Question
#include<stdio.h>
struct my_struct
{
int i;
unsigned int j;
};
void main()
{
struct my_struct temp1={-32769,-1},temp2;
temp2=temp1;
printf("%d %u",temp2.i,temp2.j);
}
What will be output if you compile following c code ?
#include<stdio.h>
struct my_struct
{
int i;
unsigned int j;
};
void main()
{
struct my_struct temp1={-32769,-1},temp2;
temp2=temp1;
printf("%d %u",temp2.i,temp2.j);
}
Answer: Option D
Was this answer helpful ?
An entire structure variable can be assigned to another structure variable, provided both variables have the same composition.
Was this answer helpful ?
Submit Solution