#include<stdio.h>
int main(){
int a[]={1,2,3,5,1};
int *ptr=a+4;
int y=ptr-a;
printf("%d",y);
}

Answer Posted / harsha

as per my knowledge..4
a is base address of array
every array is a pointer
difference between the pointers is count of data elements ,but not difference between address
y=a+4-a
i.e., y=4

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1597


What is c language used for?

560


How can you tell whether a program was compiled using c versus c++?

620


In C language, a variable name cannot contain?

745


What is the purpose of sprintf() function?

606






What does == mean in texting?

669


What is a pragma?

671


What is the difference between #include

and #include “header file”?

554


What is a scope resolution operator in c?

752


Is void a keyword in c?

578


Are the expressions * ptr ++ and ++ * ptr same?

670


Is struct oop?

583


what is the height of tree if leaf node is at level 3. please explain

1603


What is the collection of communication lines and routers called?

614


What is meant by errors and debugging?

649