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

print out of string in this format; 1. "rajesh" 2. \n 3. %d

5 Answers   mpower,


write a program in c to read array check element is present or not?

1 Answers  


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

0 Answers  


Can we use visual studio for c?

0 Answers  


What are the basic data types associated with c?

0 Answers  






What are local and global variables?

3 Answers  


What is ambagious result in C? explain with an example.

0 Answers   Infosys,


Why do we write return 0 in c?

0 Answers  


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

4 Answers   ME,


What is the purpose of main() function?

0 Answers  


How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?

2 Answers  


Combinations of fibanocci prime series

0 Answers  


Categories