edited by
563 views
0 votes
0 votes

Consider the following code:

Which of the following represents the number of additions performed by above code?

edited by

2 Answers

0 votes
0 votes
the loop wii execute from 1 to 8000 (20*20*20)

in this half will be even and half will be odd

so output will be 4000; which is equal to number of addition
0 votes
0 votes

i think this question is for no. of additions operation not value of d

No. of additon operation is going to be:-) 4000(for executing d+1)+8000*2 (for (i+j)+k)) + 20+20*20+20*20*20  for i++ j++ and k++ respectively

these are going to be:- 28420  ????

Related questions

1 votes
1 votes
1 answer
1
nikkey123 asked Jan 3, 2018
412 views
0 votes
0 votes
2 answers
2
junaid ahmad asked Dec 24, 2017
378 views
Let f (n) = Ο(n), g(n) = Ο(n) and h(n) = θ(n).Then [f (n) . g(n)] + h(n) is : a) Ο(n) b)θ(n)I think it must be 0(n)
0 votes
0 votes
1 answer
3
1 votes
1 votes
1 answer
4
thor asked Jan 15, 2017
314 views