. 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

What is calloc in c?

0 Answers  


How can I remove the leading spaces from a string?

0 Answers  


What do you know about the use of bit field?

0 Answers  


what are two categories of clint-server application development ?

1 Answers  


change to postfix a/(b+c*d-e)

8 Answers   Value Labs,






What is a lvalue

0 Answers   Global Logic,


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

0 Answers  


how to add two numbers without using arithmetic operators?

4 Answers  


write a program to remove occurrences the word from entered text?

1 Answers  


What is the basic structure of c?

0 Answers  


number 2 plssssss help !!....using array.. turbo c.. create a program that will accept a number and determine if it is a happy number or an unhappy number.. example: enter a number : 7 7*7=49 then 4 and 9 4*4 and 9*9== 16 + 18 gives you 97 then 9 and 7 9*9 and 7*7 == 81 + 49 gives you 130 then 1 and 3 1*1 and 3*3 == 1 + 9 gives you 10 1*1 gives you 1 sample output: 7= 49= 16+81= 97= 81+49=130 =1+9=10 =1 "7 is a happy number" . if the last number is 2 then the number being inputed is not a happy number.

3 Answers  


2. What does static variable mean?

2 Answers  


Categories