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


Please Help Members By Posting Answers For Below Questions

What is null character in c?

690


Why c is known as a mother language?

644


How can you convert integers to binary or hexadecimal?

616


Can you return null in c?

597


Write a program to print factorial of given number without using recursion?

569






What is #include conio h?

594


What is static and volatile in c?

779


How old is c programming language?

577


What is difference between array and pointer in c?

538


write a program for the normal snake games find in most of the mobiles.

1786


What is %d used for?

585


What is the process of writing the null pointer?

607


What is the scope of static variable in c?

535


How a string is stored in c?

587


What are the difference between a free-standing and a hosted environment?

745