main()

{

int i = 257;

int *iPtr = &i;

printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );

}



main() { int i = 257; int *iPtr = &i; printf("%d %d", *((..

Answer / susie

Answer :

1 1

Explanation:

The integer value 257 is stored in the memory as, 00000001
00000001, so the individual bytes are taken by casting it to
char * and get printed.

Is This Answer Correct ?    16 Yes 1 No

Post New Answer

More C Code Interview Questions

Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


main() { extern int i; i=20; printf("%d",i); }

1 Answers   Value Labs,


There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.

1 Answers   TCS,


C program to print magic square of order n where n > 3 and n is odd

2 Answers   Accenture,


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


Cluster head selection in Wireless Sensor Network using C programming language.

1 Answers  


main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

9 Answers   HCL, Wipro,


main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 Answers  


#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


Categories