Computer Science, asked by Artybabe, 1 year ago

PHOTO. I will give free candies to anyone who ans this

Attachments:

jenny2003: i want candy but i don't know the answer
Artybabe: Then no candy for u
jenny2003: okay fine i will buy it.

Answers

Answered by siddhartharao77
2
(1) int a = 1; a<=2; The condition is true. It will enter the inner loop.

(i) int b = 1;1 < =4; 

The condition is true, it will print *;

b++;

(ii) int b = 2; 2<=4;

The condition is true it will print *;

b++;

(iii) int b=3; 3<=4;

The condition is true it will print *;

b++;

(iv)int b = 4; 4<=4;

The condition is true, it will print *;

b++.

(v) b = 5 ; 5<=4.

The condition is false, It comes out of that loop. 

The value will be ****.


(2) a = 2; a<=2 ---- The condition is true. It will enter the inner loop.

int b = 1; 

Same process. it repeats until the expression is false.


Finally,

The output is:

****

****



Hope this helps!

siddhartharao77: :-)
Artybabe: thank u soo much
Similar questions