Computer Science, asked by Artybabe, 1 year ago

Is the ans 20 times?Pls ans@aryamohan

Attachments:

Answers

Answered by Aryamohanan23
1
5 times 

hope this answer help you

Aryamohanan23: is there any doubt plz free to ask
Answered by siddhartharao77
1
Logical Question:

The output is *

If u remove the semicolon at the end of the for loop, then the output will be:

(1) i = 0; 0 < 10

The condition is true, So it will print *.

i = i + 2;

0 = 0 + 2;

2.



(2) i = 2; 2 <10

The condition is true, it will print * 

2 + 2.

4



(3) i = 4; i<10

The condition is true, it will print '*';

4 + 2 

6.




(4) i = 6; 6<10;

The condition is true, it will print '*';

6 + 2

8



(5) i = 8 ;i <10

The condition is true, it will print *.

8 + 2

10.




(6) i = 10; 10<10.

The condition is false.

Therefore the loop terminates and the next, the number of stars are printed.


Therefore the output is 5 stars(*****).


Hope this helps!
Similar questions