Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The loop repetition condition of a for statement is tasted at the end of each pa

ID: 3835154 • Letter: T

Question

The loop repetition condition of a for statement is tasted at the end of each pass. In counting loops, the counter must be initialized to I before execution of the loop body begins. for loop is a post condition loop. 4. If a function does not return a value than that function is a void function. Because the following statement is a valid call to function wow, wow must be a void function. num = wow (x, y); Which of the following statements calls function abc? call abc; abc; p - abc (q); void abc (void); none of the above What value is assigned to q in the statement q = f (3, 3, 4); if f is defined as follows? int f(int q, int b, int c) {int p; p = q * b + 2 * c; return (p);}

Explanation / Answer

1)1) false .it is tested before the each pass

for(int i =0;i<10;i++)

in this i =0now it will check the condition if the condition is true then the loop will execute.

2) Fasle the vlaue of counter can be initialize dto ny value.

1)3) for loop is pre condition loop .in pre condition the condition is checked if the condition is true then loop will execute.otherwise the loop will skipped if condition is false.

4) true.because the void function does not retrn a value to return a value use int .

5) false because it return the value it must be int function.

2)1)the proper method to call a function is p=abc(q).the value of q is given from the main function.and function abc will return the value of p.

2)2) the value of q is 17 the value of q is 3 ,value of b is 3 and value of c is 4 so the function will retun 17 after calculation