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's the right way to use errno?

0 Answers  


Explain about block scope in c?

0 Answers  


what is real time system?what is the differance between hard and soft real time systems

2 Answers  


write the program for maximum of the following numbers? 122,198,290,71,143,325,98

5 Answers  


What are categories used for in c?

0 Answers  






What is diffrance between declaration and defination of a variable or function

4 Answers  


What is hashing in c language?

0 Answers  


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

0 Answers  


Write a program to print prime nums from 1-20 using c programing?

13 Answers   IBM,


how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");

9 Answers   TCS,


Describe the difference between = and == symbols in c programming?

0 Answers  


any string of bits of length 'n' represents a unique non- negative integer between.............?

2 Answers  


Categories