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

What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

1 Answers  


Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)

3 Answers   Disney, Google, ZS Associates,


main() { char not; not=!2; printf("%d",not); }

1 Answers  


String reverse with time complexity of n/2 with out using temporary variable.

10 Answers   NetApp, Symantec,






write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }

2 Answers  


Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

1 Answers  


What are the files which are automatically opened when a C file is executed?

1 Answers  


#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


main() { clrscr(); } clrscr();

2 Answers  


Categories