#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



#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a..

Answer / shraddhacpawar

a

Is This Answer Correct ?    17 Yes 2 No

#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a..

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

#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a..

Answer / kedar

a

Is This Answer Correct ?    1 Yes 0 No

#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a..

Answer / ashwini

c

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

Is an array parameter is always "by reference" ?

1 Answers  


WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS

4 Answers  


How can I find the day of the week given the date?

0 Answers  


write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


How does C++ help with the tradeoff of safety vs. usability?

1 Answers  






List the difference between a While & Do While loops?

0 Answers   Accenture,


Write a c program to demonstrate Type casting in c?

2 Answers  


What do you mean by command line argument?

0 Answers   TCS,


Are global variables static in c?

0 Answers  


what is difference between procedural language and functional language ?

4 Answers   Wipro,


What is a structure in c language. how to initialise a structure in c?

0 Answers  


write a program in c language to print your bio-data on the screen by using functions.

0 Answers  


Categories