recategorized
2,586 views

3 Answers

Best answer
2 votes
2 votes
loop will execute 30x30x30 =27000 times but since the condition is for multiples of 3  so

value of d incremented for i+j+k =3,6,9......etc

i.e  for i=1, j=1,k=1,4,7,10...28(10 times)  

similarly for i= 1 , j=2 ,k=3,6,9...29(10 times)  so in general for i=1 there will be 30*10 =300 such combinations for each i

and in total (i=1 to 30 )  =300*30 =9000

hence ans is A
selected by
0 votes
0 votes

value of d will be incremented for each run of innermost loop.

Innermost loop runs 30 x 30 x 30 =2700 times.

hence value of d = 2700

Answer:

Related questions

1 votes
1 votes
1 answer
1
go_editor asked Jul 21, 2016
1,691 views
What is the output of the following program segment?sum(n) { if (n<1) return n; else return (n+sum(n-1)); } main() { printf(&ldquo;%d&rdquo;, sum(5)); }10161514
1 votes
1 votes
2 answers
2
go_editor asked Jul 21, 2016
3,628 views
What is the size of the following union? Assume that the size of int=2, size of float =4, size of char=1union tag { int a; float b; char c; };2417