Can someone please explain this in steps?
2. Determine the output
k = 4
m = 0
n = 7
While j < k
m = 5
While m < n
Ouput “X”
m = m + 1
Endwhile
j = j + 1
Endwhile
Output j, k, m, n
// initialization of varibles
// here k= 4, m =0, n = 7
k = 4
m = 0
n = 7
// iterating the loop untill j is less than k.
// j must be smaller than 4
While j < k
// value of m becomes 5 after the loop
m = 5
// here iteration of loop is untill m is less than n
// here n = 7
While m < n
// print X
Ouput “X”
// increment the value of m by 1
m = m + 1
// first while loop will be ended
Endwhile
// increment the value of j by 1
j = j + 1
// end of second while loop
Endwhile
// print the value of j k m n
Output j, k, m, n
--------------------------------------------------------------------------------------------
NOTE: The given code will give error because j variable is not initialized,.
PLEASE LET ME KNOW IF YOU WANT MORE INFO.
PLEASE UPVOTE
Get Answers For Free
Most questions answered within 1 hours.