Question
Can someone please explain to me how many times the line "result = 1" in the "j" loop is suppose to execute?
/ assune that N is a constant that is defined in sone vay int uhoKnos) int i.j,k,result; result 1; result *= k; }} return result: Figure 1: Code for whoKnows 2100 Quiz 4 On this quiz record your name, 2100 lecture section nmber (either 1 or 2) and answers to the Questions 1, 2 and 3 below all relate to Figure 1. 1. Consider the function "whoKnows, Assiume that N is set to 10. How many tiues will the 3 questions, each which has a single correct answer. CLEARLY mark your answer. line reault 1 in the j loop be executed. (a) 10 (b) 25 (c) 55 (d) 100
Explanation / Answer
Outer for loop will run from 0 to 9 i.e. 10 times
Second loop runs from 1 to 9 i.e 9 times
So result = 1 will run 10*9 = 90 times, which is not there in option , So none of these..