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)
Answer Posted / 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 |
Post New Answer View All Answers
When should a type cast be used?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is auto keyword in c?
What is %g in c?
What is spaghetti programming?
Why is c called a structured programming language?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
Why main function is special give two reasons?
What is main function in c?
What are the two types of structure?
Add Two Numbers Without Using the Addition Operator
What is the difference between declaring a variable and defining a variable?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Does sprintf put null character?
How does struct work in c?