Questions tagged as 'visualg'

1
answer

Perfect numbers

algoritmo "numeros_perfeitos" var c, n:inteiro nv, np, npv:real inicio para n <- 1 ate 100 faca para c <- 1 ate n faca se n % c = 0 entao nv <- n / c se nv < n entao np <- nv + np fimse...
asked by 03.10.2017 / 15:19
1
answer

Divisible - portugol (VISUALG)

I have the following question and below what I have tried but it is not showing only the divisible numbers that is my intention. I'm doing the test by typing the number 8, the correct program was to say " 8 is divisible by 8 and by 2 " Wri...
asked by 01.06.2017 / 04:12
1
answer

Matrix with strings in Visualg

I'm having difficulty with the following question:    Create an M matrix [21,10]. Read 10 names (maximum 20 characters) and store in the first row of the array. After reading, decompose the names letter by letter and store them in the other l...
asked by 23.05.2017 / 21:19
2
answers

How to put different texts for "yes" and "no" in Visualg?

I recently started programming, and I'm doing an algorithm that guesses the user's age, and I'm using Visualg to practice programming logic. How to put sim or não commands in Visualg, and if the person chooses sim , enter...
asked by 10.11.2016 / 22:27
1
answer

How to save data in .txt file in VisualG?

Staff need to make a registration system in Portugol for a college job. However, I want the data to be saved for a possible query. Is it possible to save data in a .txt file in VisualG? (I searched for the "file" command but I did not unde...
asked by 22.10.2017 / 06:09
1
answer

Find repeating numbers in lists with Visualg

   Write a program that receives 100 numbers entered by the user. At the end the program displays how many numbers you enter are the same as the last number entered. As far as I can go: algoritmo "semnome" // Função : // Autor : // Data :...
asked by 31.05.2017 / 03:59
1
answer

What's the difference between the "while" structure and repeat in VisualG?

What's the difference between the "while" structure and repeat in VisualG? Do you have an example?     
asked by 20.11.2016 / 16:44
1
answer

Is there any way to round a negative value to zero in VisuAlg?

I would like to always display Vida: 0 in the last block, even if the value is negative, without doing this "Gambiarra" that I made just below. Is there a function that rounds vidaInimigo , without having to create an additional...
asked by 06.06.2018 / 13:07
1
answer

Using LOG in VISUALG Functions

When using LOG in visualG a problem is occurring, I need to split a value entered by the user, by log 2 in base 10. But he does not do this error. funcao menu_8():inteiro var logaritmo :real inicio para contador de 0 ate 12 faca logaritm...
asked by 17.06.2016 / 15:43
1
answer

Visual G: What does the ':' character mean and how does it influence the results?

I'm learning to use visual g for this material here: link In this particular code I have a very small question, which contains no answers in either material or google. algoritmo "exemplo" var x: real y: inteiro a: caractere l: logico inic...
asked by 28.06.2017 / 18:49