2 votes 2 votes Consider the following Pseudo-code segment: k:=0 for $i_1$:=1 to n for $i_2$ := 1 to $i_1$ : : : for $i_m$:=1 to $i_{m-1}$ k:=k+1 The value of k after the execution of this code shall be $C(n+m-1, m)$ $C(n-m+1, m)$ $C(n+m-1, n)$ $C(n-m+1, n)$ Programming in C ugcnetcse-june2012-paper3 programming algorithms + – go_editor asked Jul 6, 2016 edited May 30, 2020 by soujanyareddy13 go_editor 2.3k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Let n=3 and m=2 so, i1:1 to 3 i2=1 to i1 Now, when i1=1, i2 iterates only for i2=1 so k=1 when i1=2, i2 iterates for i2=1 and i2=2so k=3 when i1=3, i2 iterates for i2=1,i2=2,i2=3 so k=6 =>K=6 C(n+m-1, m)=C(4,2)=6, sO A is correct gshivam63 answered Jul 6, 2016 gshivam63 comment Share Follow See all 0 reply Please log in or register to add a comment.