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 data structures in c and how to use them?

0 Answers  


Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.

7 Answers   Accenture, Gridco, IBM, Kevin IT, TCS, Vimukti Technologies,


What is build process in c?

0 Answers  


how to find turn around time in operating system?

3 Answers  


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

0 Answers  






Can a pointer be volatile in c?

0 Answers  


Are enumerations really portable?

0 Answers  


Does sprintf put null character?

0 Answers  


Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.

2 Answers  


What is a stream in c programming?

0 Answers  


will u please send me the placement papers to my mail???????????????????

0 Answers  


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


Categories