main()
{
int ptr[] = {1,2,23,6,5,6};
printf("%d",&ptr[3]-&ptr[0]);
}
Answer Posted / dipak
In int at least 2 bytes are used for size and we know that &ptr[] gives the address of ptr .
&ptr[3]-&ptr[0]
Size of &ptr[3] is 3*2=6 times greater than Size of &ptr[0] is 1*2=2
ptr[0] also have any value that's why I consider it 1
So 6-2=4
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is null character in c?
Why c is known as a mother language?
How can you convert integers to binary or hexadecimal?
Can you return null in c?
Write a program to print factorial of given number without using recursion?
What is #include conio h?
What is static and volatile in c?
How old is c programming language?
What is difference between array and pointer in c?
write a program for the normal snake games find in most of the mobiles.
What is %d used for?
What is the process of writing the null pointer?
What is the scope of static variable in c?
How a string is stored in c?
What are the difference between a free-standing and a hosted environment?