C Programming - Pointers - Discussion

Discussion Forum : Pointers - Find Output of Program (Q.No. 2)
2.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int i=3, *j, k;
    j = &i;
    printf("%d\n", i**j*i+*j);
    return 0;
}
30
27
9
3
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
65 comments Page 6 of 7.

Shreyan said:   9 years ago
Thanks, @Munny. Your method seemed simple and short :).

Jp said:   4 years ago
@ALL.


Just simplify it;

i*(*j)*i+(*j).
3*(3)*3+3.
(3)

Spurthi said:   1 decade ago
Here i**j=3*3=9.

i**j*i=9*3=27.

i**j*i+*j=27+3=30.

Preeti said:   1 decade ago
Thanx Ajay Kumar Varma..explanation was great!!

Satti(iiit) said:   1 decade ago
Very nice munny. I am getting your explanation.

Divya said:   1 decade ago
Thank you munna simple and best explanation

Zohra said:   1 decade ago
Well explained. Munny and Nihar. Thank You.

Rakesh said:   1 decade ago
Munny and nihar gave correct explanation.

Roopa said:   1 decade ago
Please tell the meaning of i**j*i+*j .

Neha said:   1 decade ago
Ok but why do we try out and make j=3.


Post your comments here:

Your comments will be displayed after verification.