Computer Science, asked by PrativaDewri, 1 year ago

Ansr this..n plz explain the answer!!

Ansr it crrctly n get brainly!!✌✌
NO SPAM❌❌❌

Attachments:

Answers

Answered by hanushoo7
0

10 times because ofk=k+3 and

k is less than or equal to l


PrativaDewri: I knw the ansr is 10..bt how explain it
hanushoo7: hi it is spaces of 3 till L
PrativaDewri: I cant underatand what r u saying
Answered by siddhartharao77
4

Sample Program:

int K = 3, L = 32;

while(K <= L)

{

K = K + 3;

}

Explanation:

(i) When k = 3:

While( 3 <= 32)   ------ true

{

K = 6;

}

(ii) When K = 6:

While(6 <= 32)   ----- true

{

K = 9;

}

(iii) When k = 9;

While(9 <= 32)      --------- true

{

K = 12;

}

(iv) When K = 12;

While(12 <= 32)       --------- true

{

K = 12;

}

(v) When K = 15;

While(15 <= 32)           ------------ true

{

K = 18;

}

(v) When K = 18;

While(18 <= 32)            ----------- true

{

K = 21;

}

(vi) When K = 21;

While(21 <= 32)            ------------ true

{

K = 24;

}

(vii) When K = 24;

While(24 <= 32)         ------------- true

{

K = 27;

}

(viii) When K = 27;

While(27 <= 32)            --------------- true

{

K = 30;

}

(ix) When K = 30;

While(30 <= 32)            --------------- true

{

K = 33;

}

(x) When K = 33;

While(33 <= 32)      --------- False

{

Loop terminates.

Therefore, the loop gets executed 10 times.

Hope it helps!

Similar questions