Questions tagged as 'visualg'

1
answer

visualg ladder line break

I'm having trouble with the code to break the line. I need to create a ladder that looks like this: # ## ### #### ##### If I put "#" ("#") it breaks the line, but the end result looks like this: # # # # # # # # # #...
asked by 06.06.2016 / 01:17
1
answer

Algorithm VisualG: disregard number 0

I'm solving the following exercise:    Write an algorithm that calculates the mean of the numbers entered by the user, if they are even. Finish reading if user types zero (0) However, when I type 0 to finish, it counts 0 as even number, a...
asked by 10.07.2018 / 18:06
1
answer

How to make a variable save each number that a counter divides by a certain number?

Let's suppose that the number is 12. How to show the numbers 1, 3, 6, 12 in front? I put a note in front of the line of code that I'm talking about. algoritmo "Nums primos" var N,C,TotNums : inteiro inicio C <- 1 TotNums <- 0...
asked by 11.12.2016 / 18:52
3
answers

Sum of integers from 1 to 100

I'm trying to create an algorithm that adds up the numbers in the range 1-100. In addition the program prints each element of the sum and at the end the result. That is, 1 + 2 + 3 + 4 + 5 + 6 ... Important: Using pseudo-language (portugol)...
asked by 11.04.2018 / 17:30
1
answer

End repeat loop Repeat Visualg

When we use repita together with ate at the end of the block, should we also use fimrepita ? If not, when do we use this? algoritmo "semnome" var t,n,i,m:inteiro inicio i<-0 repita escreval ("entre com a n...
asked by 06.07.2018 / 18:28
1
answer

Age Counter

Good afternoon guys, all right? I have an exercise here from the Faculty of Algorithms I, follow the statement below: Write an algorithm that requests the age of several people (USE REPEAT). Enter the total number of people under 25 and...
asked by 09.05.2018 / 17:00
2
answers

Return only positive results

I'm doing an exercise in visualg, in which the result can be both negative and positive, but I want the results only positive rather than negative. How to achieve this? What I have so far: algoritmo "semnome" // Função : // Autor : // Data : 0...
asked by 03.01.2018 / 22:11
1
answer

How to make a character-type variable receive another in a conditional structure in VisualG?

I am making an algorithm to show the highest grade and on this higher grade, show the name of the student who took the higher grade. At first everything seems ok, but it is not working. Where is the error? algoritmo "melhor aluno" var Quantida...
asked by 20.11.2016 / 18:48
1
answer

Test output value to see if it is INTEGER

I set the function below to check whether the output value is integer or real. funcao menu_8():inteiro var logaritmo :real inicio para contador de 0 ate 12 faca logaritmo <- ((log(i[contador])) / (log(2)))...
asked by 17.06.2016 / 16:32
1
answer

How to create an indeterminate algorithm using visualg?

I need to create an algorithm that returns different values each time I run, even though I get the same input values. It aims to solve an issue where I need to analyze the generation of a certain living being who is more likely to have no chi...
asked by 03.05.2016 / 20:16