Given a piece of code
int x[10];
int *ab;
ab=x;
To access the 6th element of the array which of the
following is incorrect?
(A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .

Answers were Sorted based on User's Feedback



Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which o..

Answer / pradeep

answer: D(invalid indirection)

Is This Answer Correct ?    17 Yes 1 No

Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which o..

Answer / sandzee

d

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

0 Answers  


why do some people write if(0 == x) instead of if(x == 0)?

0 Answers  


main() { int a[10]; printf("%d",*a+1-*a+3); }

2 Answers  


#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }

3 Answers   VB,


What is use of integral promotions in c?

0 Answers  


1. Write a program to reverse every second word in a given sentence.

1 Answers  


How to throw some light on the b tree?

0 Answers  


How to print "Hi World" without using semi colon?

6 Answers   Infosys,


What does %c mean in c?

0 Answers  


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

0 Answers   Wilco,


What is non linear data structure in c?

0 Answers  


cavium networks written test pattern ..

0 Answers   Cavium Networks,


Categories