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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / anunithi

4

Is This Answer Correct ?    6 Yes 3 No

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

Answer / sridhar

1

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Explain enumerated types.

0 Answers  


write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised

3 Answers  


how to print this sereis 2 4 3 6 5..........?

3 Answers  


Reverse a string word by word??

9 Answers  


how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


Describe static function with its usage?

0 Answers  


What are disadvantages of C language.

0 Answers   iNautix,


c program to print a name without using semicolon

9 Answers   TCS, Wipro,


What is the acronym for ansi?

0 Answers  


What is difference between scanf and gets?

0 Answers  


how can u print a message without using any library function in c

1 Answers   NIIT,


Explain what is the benefit of using enum to declare a constant?

0 Answers  


Categories