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;
}
Discussion:
65 comments Page 5 of 7.
Eswari reddy said:
8 years ago
i=3,*j,k;
j=&i; then
j=&3 means *j=3
i**j*i+*j=3*3*3+3=27 +3=30.
j=&i; then
j=&3 means *j=3
i**j*i+*j=3*3*3+3=27 +3=30.
Sunil Phad said:
9 years ago
j=&i,
So, *j=i;
*j=3
i**j
3*3=9
i**j*i
9*3=27
i**j*i+*j
27+3 = 30.
So, *j=i;
*j=3
i**j
3*3=9
i**j*i
9*3=27
i**j*i+*j
27+3 = 30.
Munny said:
2 decades ago
j=&i implies *j=i;
*j=3
i**j=3*3=9
i**j*i=9*3=27
i**j*i+*j=27+3=30
*j=3
i**j=3*3=9
i**j*i=9*3=27
i**j*i+*j=27+3=30
SUMIT JOSHI said:
4 years ago
@All.
According to me;
i**j*i+*j,
i*(*j)*i+(*j),
3*3*3+3,
27+3,
= 30.
According to me;
i**j*i+*j,
i*(*j)*i+(*j),
3*3*3+3,
27+3,
= 30.
(10)
SaiBheema said:
1 decade ago
i=3 and j=3, since j=&i.
[((i*(*j))*i)+*j]=[((3*3)*3)+3].
= 30.
[((i*(*j))*i)+*j]=[((3*3)*3)+3].
= 30.
Nishu.. said:
1 decade ago
i=3,
*j=3,
Because j = &i;
Therefore i**j*i+*j = 3*3*3+3 = 30.
*j=3,
Because j = &i;
Therefore i**j*i+*j = 3*3*3+3 = 30.
Nap said:
1 decade ago
Answer = 30 because,
i**j*i+*j = (3*3*3+3).
Where i=3 and *j=3.
i**j*i+*j = (3*3*3+3).
Where i=3 and *j=3.
Ashish kathait said:
1 decade ago
=i**j*i+*j {becoz *j=3)
=i**j*i+ 3
=i*3*i+ 3
=3*3*3+3
=30
=i**j*i+ 3
=i*3*i+ 3
=3*3*3+3
=30
Siddharth said:
1 decade ago
i**J = 3*3 = 9
i**j*i = 9*3 = 27
i**j*i+*j = 27+3 = 30.
i**j*i = 9*3 = 27
i**j*i+*j = 27+3 = 30.
Subroto Biswas said:
1 decade ago
It's simple:
= 3*3*3+3.
So, 9*3+3 = 27+3.
Finally, 30.
= 3*3*3+3.
So, 9*3+3 = 27+3.
Finally, 30.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers