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

In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

0 Answers  


1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1

4 Answers  


Diff between for loop and while loop?

2 Answers   TCS,


What are the different types of control structures in programming?

0 Answers  


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

0 Answers   Expedia,






Explain how can I prevent another program from modifying part of a file that I am modifying?

0 Answers  


52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

25 Answers   Datamatics, Solartis, TCS, ThinkBox, Trine,


Are there constructors in c?

0 Answers  


what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }

4 Answers  


Are the variables argc and argv are local to main?

0 Answers   TISL,


int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?

4 Answers   TCS,


WHOT IS CHAR?

4 Answers   TCS,


Categories