Invert the size of the letters box - VISUALG

0

I'm having a problem, programming algorithms in visualG. I need to invert an array with values assigned to it.

// opcao 18
funcao menu_18():caractere
var
inicio
escreval (" A ORDEM INVERSA É: ")
para contador de 12 ate 0 faca
     escreva(" ", c[contador])
fimpara
escreval(" ")
fimfuncao

where the counter values are from 0 to 12, with characters assigned to them, but I need to print the inverse of them.

example (" A B C ")

saída: (" C B A ")

What would be the best resolution for this problem?

    
asked by anonymous 08.06.2016 / 01:48

1 answer

1
escreval (" A ORDEM INVERSA É: ")
para contador de 12 ate 0 faca
     escreva(c[contador])
fimpara

This excerpt is correct, confirm if your vector is [0..12], see if you are correctly assigning the values to the vector, I do not know if you are setting the values in the code itself or if you are reading from the keyboard, but Anyway, it is likely that if you have any problems, it is time to assign the data to the vector.

    
08.06.2016 / 14:08