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...


. Consider the following program
main()
{
int a[5]={1,3,6,7,0};
int *b;
b=&a[2];
}
The value of b[-1] is
(A) 1 (B) 3 (C) -6 (D) none

Answers were Sorted based on User's Feedback



. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / gagan

answer is 3
bcz b[0]=6 so b[-1]=3

Is This Answer Correct ?    23 Yes 6 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / sujay

I think the answer is none
bcoz b is a pointer var so, it points to an ad location
the answer is not any of the given options

Is This Answer Correct ?    8 Yes 2 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / veerendra

here b is an pointer. u r askng the value stored in a b's
array of -1....pointer may not be array here..

Is This Answer Correct ?    5 Yes 1 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / sandip talukder

answer is(B). coz b holds d adrs ofa[2].so b[0]is 6. thats
why b[-1] is 3.

Is This Answer Correct ?    5 Yes 1 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / megh singh rana

HERE address of location a[2] assined to b .now b stre this
data in o location as b[0],so b[-1] is the value immediate
before b[0]( 6) is 3,thats why answer of b[-1] is 3,

Is This Answer Correct ?    5 Yes 1 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / bipin chandra sai.s

ans is none,bcoz b has been assigned address &[2],but it
has been asked that ans for b[-1],so the location -1 is not
there,we have locations from 0,1,2,3..,so none is the ans

Is This Answer Correct ?    4 Yes 2 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / cvramana.reddy10

please answer it with reason..

Is This Answer Correct ?    5 Yes 4 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / kupendiran

3

Is This Answer Correct ?    1 Yes 0 No

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The v..

Answer / harichandana

a[2] value is assigned to b i.e a[2] element value 6 is stored in b[0].now b[-1] means element before 6 i.e 3....thus b[-1] is 3

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

question-how to run a c programme.

6 Answers  


What is main function in c?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20%,da18%/*

6 Answers  


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

0 Answers  


I need to take a sentence from input and sort the words alphabetically using the C programming language. Note: This is C not C++. qsort and strtok not allowed

4 Answers   Aspire,


Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }

3 Answers   NDS,


Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain

2 Answers  


how can i get this by using for loop? * ** * **** * ******

3 Answers   Excel,


What will be the output of following program #include main() { int x,y = 10; x = y * NULL; printf("%d",x); }

1 Answers  


Is it possible to run using programming C for Java Application?

2 Answers   NIC,


explain what is an endless loop?

0 Answers  


Categories