Determine The output produced by each of the following state


Determine The output produced by each of the following statements: for

Solution

(a) ******

Here the for loop runs and print 6 times star.

(b) 7

The loop runs and ends and then it prints value of i

(c) 49

The do-while loop run at least once and then in while the condition is false and it breaks there.

(d) 10 8

first i is 5 so it prints 2*5=10 then i is decremented and it becomes 4 so 2*4 is printed and when i becomes 3 it equals n and conditions becomes false.

 Determine The output produced by each of the following statements: for Solution(a) ****** Here the for loop runs and print 6 times star. (b) 7 The loop runs an

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site