study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above
Answer Posted / venkataramani kumar.t.b.
The Answer is C) a=101 and (*p)=101.
Since the variable is not directly accessed and it
increments thru' the pointer, so the answer is valid
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
Explain do array subscripts always start with zero?
Which one would you prefer - a macro or a function?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What does sizeof int return?
Which built-in library function can be used to match a patter from the string?
How do you write a program which produces its own source code as output?
Why c is a mother language?
Is that possible to add pointers to each other?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What is modifier & how many types of modifiers available in c?
What is this pointer in c plus plus?
What are the application of c?
What is .obj file in c?
What is ambagious result in C? explain with an example.
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)