351 views

2 Answers

1 votes
1 votes
Ans is 76.

i=4 initially

p= i++ * i++

now it is post increment operator , so it will use i first then increment.hence,

p= 4 * i ++ // after using 4 , value of i ,that is 4 will be incremented to 5

p=4* 5 // after using 5 ,value of i that is 5 will be incremented to 6

so, p=20

now q= ++i * ++i

now it is pre increment operator , so it will  increment first then use value ..hence,

q= 7 (now i value 6 will be first incremented first then used) *( increment i value again so i becomes 8 then use) 8

q=56

so final ans is p+q=20+56=76

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
2 answers
4
atulcse asked Jan 15, 2022
662 views
Consider the following programint find (int n) { int a = 1; for (i = 1; i < = n; i ++) for (j = 1; j < = i; j++) for (k = 1; k <= j, k++) a = a + 1; ...