ewrite the following C++ code in pseudocode. (5)
for (int x = 1; x <= 10; x++) {
for (int y = 10; y >= x; y--) {
if (y % 2 == 0) {
cout << "*";
}
else {
cout << "#";
}
}
cout << endl;
x <- 1
while x <= 10 do
y <- 10
while y >= 10
if y mod 2 is 0
output '*'
else
output '#'
y <- y-1
x <- x+1
output end_of_line
Comments
Leave a comment