Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


given the piece of code
int a[50];
int *pa;
pa=a;
to access the 6th element of the array which of the
following is incorrect?
a.*(a+5)
b.a[5]
c.pa[5]
d.*(*pa + 5)

Answers were Sorted based on User's Feedback



given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / karthik

void main()
{
int a[50]={1,2,3,4,1,55};
int *pa;
pa=a
printf("%d",*(pa+5));
}

we will the sixth element

its not pointer to the pointer ie *(*pa+5);

Is This Answer Correct ?    38 Yes 4 No

given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / fazlur rahaman naik

d is the right answer.

Is This Answer Correct ?    19 Yes 2 No

given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / jaya prakash

Answer is D.
It is not a pointer to pointer.So we cannot use two stars.

Is This Answer Correct ?    6 Yes 1 No

given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / yatish m yadav

The wrong answer is
d> *(*pa+5)
here value pointed to by pa is accessed and added 5 to it
then trying to print the value at that address, which gives
us an warning with some garbage value.

Is This Answer Correct ?    5 Yes 1 No

given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / vignesh1988i

d) is the wrong choice...... because , first variable pa
refers to a address of the array... * of that pa will give
you the first value of the array.. ie a[0] , then that value
will be getting added with 5 and the * which is outside wont
have any value towards this manuplation...... so this will
show an error...... illegal use of pointers.....


thank u

Is This Answer Correct ?    2 Yes 0 No

given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the a..

Answer / shivangi

c is the wrong answer

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Interview Questions

enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above

8 Answers   HCL, Wipro,


Can you please explain the difference between strcpy() and memcpy() function?

0 Answers  


who will call your main function in c under linux?

2 Answers  


how to TOGGLE Nth bit of variable in a MACRO

1 Answers   NDS,


Difference between C and Embedded C?

1 Answers  


What is the purpose of void pointer?

0 Answers  


Explain what is meant by high-order and low-order bytes?

0 Answers  


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

0 Answers   RBI,


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

0 Answers  


Is it possible to pass an entire structure to functions?

0 Answers  


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

0 Answers  


What is the scope of global variable in c?

0 Answers  


Categories