Asked by michael
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. 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
Answers
Answered by
MathMate
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.
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.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.