void main()
{
int *ptr;
ptr = (int *) 0x400 ;
printf("ptr=%d",ptr);


}
output?



void main() { int *ptr; ptr = (int *) 0x400 ; printf("ptr=%d",ptr); } output?..

Answer / koti

Ans is 1024.
Why because here ptr is pointing to integer address 0x400.this is hexadecimal address but you are printing decimal value.
The hexadecimal value is
........0000 0100 0000 0000
2 power10 =1024.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What are c preprocessors?

0 Answers  


Why does this code crash?

0 Answers  


ratio,age,persentage

0 Answers  


What is size of union in c?

0 Answers  


What are terms in math?

0 Answers  






how the size of an integer is decided? - is it based on processor or compiler or OS?

19 Answers   HCL, JPR, Microsoft, nvidia,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it

5 Answers   ABS, Accenture, HCL, Infosys, Infotech, SoftSolve, Software India, TCS, Vertex, Vimukti Technologies,


What is meant by initialization and how we initialize a variable?

0 Answers  


what is a void pointer?

2 Answers  


which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....

2 Answers  


Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


What is const and volatile in c?

0 Answers  


Categories