program
closed

closed by
450 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

8 8 votes
6 6 answers
965
965 views
GO Classes asked Jul 25, 2025
965 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...
5 5 votes
3 3 answers
676
676 views
GO Classes asked Jul 25, 2025
676 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...
6 6 votes
4 4 answers
744
744 views
GO Classes asked Jul 19, 2025
744 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...