program
closed

• closed by
457 views
0 0 votes
closed with the note: Please see already solved questions here. This is irrelevant for GATE
main()
{
int a ;
char *x;
x = (char *)&a ;
a= 512 ;
x[0] = 2 ;
 x[1]  = 2;
  printf("%d\n",a);
}

 

how the o/p is 514 plz explain someone :)
Position:
Show:

Related questions

9 9 votes
6 6 answers
1.0k
1.0k views
GO Classes asked Jul 25, 2025
1,008 views
#include <stdio.h void fun() { static int count = 0; count++; printf("%d ", count); } int main() { for (int i = 0; i < 3; i++) fun(); return 0; }What is the output of the...
6 6 votes
3 3 answers
704
704 views
GO Classes asked Jul 25, 2025
704 views
Given the pseudocode below for the function remains(), which of the following statements is true about the output, if we pass it a positive integer $n>2$ ? int remains(in...
7 7 votes
4 4 answers
768
768 views
GO Classes asked Jul 19, 2025
768 views
int arr[ ]={1, 2, 3, 4} int count; incr( ) {return ++count;} main( ) { arr[count++]=incr( ); printf("arr[count]=%d\n", arr[count]); }The value printed by the above progra...