#include<stdio.h>
main()
{
int a[3];
int *I;
a[0]=100;a[1]=200;a[2]=300;
I=a;
Printf(“%d\n”, ++*I);
Printf(“%d\n”, *++I);
Printf(“%d\n”, (*I)--);
Printf(“%d\n”, *I);
}
what is the o/p
a. 101,200,200,199
b. 200,201,201,100
c. 101,200,199,199
d. 200,300
Answer Posted / r.gopala krishnan (gk)
Explanation:
now 'I' variable pointing the base address of the
Array......
1.printf("%d\n",++*I); //I=a[0], bcos I is pointing the
base address. first Increamenting the value so,a[0]=100
become an ( a[0]=101 ).
2.printf("%d"\n,*++I); //This Increment will increment
the address not value. so, now ( I=a[1]=200 ).
3.printf("%d\n",*I--); // now I=a[1]=200 so value will
not change.
4.printf("%d\n",*I); //Now also I=a[1] pointing here only
but a[1]=199, bcos in previous printf after executing we
decrementing the value. a[1]=199......
ANS: a)101,200,200,199
| Is This Answer Correct ? | 12 Yes | 0 No |
Post New Answer View All Answers
How is a null pointer different from a dangling pointer?
What is a const pointer?
What is double pointer in c?
Explain what is the advantage of a random access file?
What is the difference between procedural and declarative language?
What is C language ?
Explain why can’t constant values be used to define an array’s initial size?
while initialization of array why we use a[][2] why not a[2][]...?
using for loop sum 2 number of any 4 digit number in c language
Explain can you assign a different address to an array tag?
what is recursion in C
Why we use stdio h in c?
What are the types of unary operators?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
What is the difference between typedef and #define?