pseudocode - Hand tracing a pseudo code -
i have pseudo code need hand trace:
begin count <- 1 while count < 11 t <- (count ^ 2) - 1 output t count <- count + 1 endwhile end i unsure <- means , don't understand t. keep getting 1,1,1, etc. every time go through. appreciated!
first off operator <- means "gets", in assignment. so:
count <- count + 1 means set variable count value count + 1.
second program output first 10 values of x2-1, so:
t <- count^2 - 1 will evaluate to:
0, 3, 8, 15, 24, 35, 48, 63, 80, 99 for values of count
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 respectively.
Comments
Post a Comment