in Programming in C
2,087 views
1 vote
1 vote


struct a
{
long int i;
char ch[4];
};

main ( )
{
struct a s;
s.i=512;
printf(“%d%d%d”,s.ch[0],s.ch[1],s.ch[3]);
}
What will be the output of following program?

  1.   Garbage value
  2.   122 4 74
  3.  ​​​​​​​ None of the above
  4.  ​​​​​​​121 2 72
in Programming in C
2.1k views

3 Comments

It will print Garbage values
0
0
why garbage?
0
0
May be a  none of above is seems to be right

because in STRUCTURE , charecter is intialized with Null by default
0
0

Please log in or register to answer this question.