2,844 views
1 votes
1 votes

#include<stdio.h>

int main()

{

   int a;

   char *x;

   x = (char *) &a;

   a = 512;

   x[0] = 1;

   x[1] = 2;

   printf("%dn",a);  

   return 0;

}

1 Answer

2 votes
2 votes

output will be machine dependent .

on little endian machine output will be 513

Related questions

0 votes
0 votes
0 answers
1
shiva0 asked Jan 11, 2019
651 views
#include int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; }
1 votes
1 votes
1 answer
4