#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
Answers were Sorted based on User's Feedback
Answer / 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 |
How can I sort more data than will fit in memory?
how to copy a string without using c function
why we are using float in C
how can I convert a string to a number?
Is a pointer a kind of array?
write a c/c++ programthat connects to a MYSQL server and checks if the INNoDB plug in is installed on it.If so your program should print the total number of disk writes by MYSQL.
#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }
What are structure members?
what is the structure?
What is the best way to comment out a section of code that contains comments?
please explain every phase in the "SDLC" in the dotnet.
What is indirect recursion? give an example?