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

Can you tell me how to check whether a linked list is circular?

1 Answers  


What are the types of data types and explain?

0 Answers  


hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


write a c program to find largest of three numbers using simple if only for one time.

1 Answers  


What is #error and use of it?

0 Answers  


Write a c program for sum of first n terms of the series S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......

2 Answers  


what are the advantage and disadvantage of recursion

5 Answers  


How to implement call back functions ?

3 Answers   HP,


write a program to display & create a rational number

1 Answers   HCL, TCS,


Disadvantages of C language.

0 Answers   Impetus,


What is the right type to use for boolean values in c? Is there a standard type?

0 Answers  


What is the difference between realloc() and free()

1 Answers  


Categories