what is the output by each psuedocode segments ?

1. a=1
b=2
c=5
while a<c
a = a+1
b = b+c
endwhile
output a, b, c

2. d=4
e=6
f=7
while d>f
d=d+1
e=e -1
endwhile
output d, e, f

3. g=4
h=6
while g<h
g=g+1
endwhile
output d, e, f

4. j=2
k=5
n=9
while j<k
m=6
while m<n
output "goodbye"
m =m+1
endwhile
j=j=1
endwhile

5. j=2
k=5
m=6
n=9
while m<n
output "hello"
m=m+1
endwhile
j=j+1
endwhile

6. p=2
q=4
while p<q
output "adios"
r=1
while r<q
output "adios"
r=r+1
endwhile
p=p+1
endwhile

1.

Make a table:
a b c
1 2 5
a<c?
2 3 5
a<c?
3 4 5
a<c?
4 5 5
a<c?
5 6 5
a<c? STOP

You can try the rest and post if you have doubts.

1. In the first pseudocode segment:

- Initialize a as 1, b as 2, and c as 5.
- Enter the while loop with the condition a < c.
- Inside the loop, increment a by 1 (a = a + 1) and update b by adding c (b = b + c).
- Repeat the loop until the condition becomes false (a is no longer less than c).
- After the loop, output the values of a, b, and c.

2. In the second pseudocode segment:
- Initialize d as 4, e as 6, and f as 7.
- Enter the while loop with the condition d > f.
- Inside the loop, increment d by 1 (d = d + 1) and decrement e by 1 (e = e - 1).
- Repeat the loop until the condition becomes false (d is no longer greater than f).
- After the loop, output the values of d, e, and f.

3. In the third pseudocode segment:
- Initialize g as 4 and h as 6.
- Enter the while loop with the condition g < h.
- Inside the loop, increment g by 1 (g = g + 1).
- Repeat the loop until the condition becomes false (g is no longer less than h).
- After the loop, output the values of g, h (mistakenly mentioned output d, e, f instead of g, h).

4. In the fourth pseudocode segment:
- Initialize j as 2, k as 5, and n as 9.
- Enter the outer while loop with the condition j < k.
- Inside the outer loop, initialize m as 6.
- Enter the inner while loop with the condition m < n.
- Inside the inner loop, output the string "goodbye" and increment m by 1 (m = m + 1).
- Repeat the inner loop until the condition becomes false (m is no longer less than n).
- Outside the inner loop, mistakenly set j equal to 1 instead of incrementing it by 1 (j = j = 1).
- Repeat the outer loop until the condition becomes false (j is no longer less than k).
- After the loops, there won't be any output, since the instruction to output "goodbye" is inside the inner loop.

5. In the fifth pseudocode segment:
- Initialize j as 2, k as 5, m as 6, and n as 9.
- Enter the while loop with the condition m < n.
- Inside the loop, output the string "hello" and increment m by 1 (m = m + 1).
- Repeat the loop until the condition becomes false (m is no longer less than n).
- Afterwards, mistakenly increment j by 1 instead of k (j = j + 1).
- After the loop, output the values of j, k, m (mistakenly mentioned output j, k instead of j, k, m).

6. In the sixth pseudocode segment:
- Initialize p as 2, q as 4.
- Enter the while loop with the condition p < q.
- Inside the loop, output the string "adios" and initialize r as 1.
- Enter the inner while loop with the condition r < q.
- Inside the inner loop, output the string "adios" and increment r by 1 (r = r + 1).
- Repeat the inner loop until the condition becomes false (r is no longer less than q).
- After the inner loop ends, increment p by 1 (p = p + 1).
- Repeat the outer loop until the condition becomes false (p is no longer less than q).
- After the loops, output the values of p, q (mistakenly mentioned output "adios" instead of output p, q).