Most voted "visualg" questions
Visualg is an algorithm editor and interpreter. Use this tag for questions related to its use, functionality or encoding.
Learn more…108 questions
Sort by count of
-
24
votes5
answers8920
viewsWhat is the difference between Visualg and Portugol?
I see here a great rummage in the tags visualg and portugol. By the tag wiki, it seems that Visualg would be the interpreter and Portugol would be the language itself. Visualg is regarded as a…
-
14
votes6
answers6260
viewsHow to determine if a number is power 2?
I need to develop an algorithm in Visualg where I enter with a number and it tells me if it’s power of 2 or not. What strategies can I use?
-
7
votes1
answer182
viewsHow to improve this algorithm?
The goal of my algorithm is to make the user train division: he will have to hit 10 times in a row the quotient whole (that is, without decimal places) and the rest of the division. I made this…
-
7
votes2
answers586
views -
6
votes2
answers40159
viewsHow to break the line at the Visualg prompt?
My way out: Name: So-and-so: so many years How to break the line on prompt of the Visualg? To look like this: Name: So-and-so Age: So Many Years…
-
6
votes3
answers4588
viewsAlgorithm with structure PARA and SE
An algorithm that reads the name and sex of fifty-six people and states her name and whether she is male or female. In the end report the total of men and women. I need the show to run on Visualg. I…
-
6
votes2
answers1673
viewsError in program in Visualg
I’m having problems with this program, because when I put it to work and type a value greater than 18, a message appears saying that is missing a FIMSE and that there is a FIMENQUANTO without a…
-
4
votes1
answer169
viewsNumberlist with Visualg
Problem with this algorithm in visualg The code is making infinite loop "Numberlist" // Função : // Autor : // Data : 09/02/2016 // Seção de Declarações var a1,b1,c1:inteiro inicio // Seção de…
-
4
votes1
answer9945
viewsHow to know if a number is integer
I need to develop an algorithm where, it divides a number by 2, until I get to the rest of the division, and I need to know if the rest of this division is an integer, what method can I apply to…
-
4
votes2
answers5747
viewsDisplay whether a person is of legal age or not
Can anyone help me with an exercise in visualg? is the following: the exercise asks so: Write a program that reads a person’s age. At the end, show whether that person is of legal age or not.…
-
3
votes2
answers612
viewsWhat is the difference between the 2 parameter passages?
There is the passage of parameter by value and by reference. I wanted examples to better understand the difference.
-
3
votes2
answers3663
viewsHow to put different texts for "yes" and "no" in Visualg?
I started recently with programming, and I’m making an algorithm that guesses the user’s age, and I’m using Visualg to practice programming logic. How to put commands sim or não in the Visualg, and…
-
3
votes4
answers604
viewsReturn only positive results
I’m doing an exercise in visualg, in which the result can be both negative and positive, only I want the results only positive and not negative. How do I get it? What I have so far: algoritmo…
-
3
votes2
answers1405
views -
3
votes3
answers13025
viewsSum of whole numbers from 1 to 100
I am trying to create an algorithm that adds the numbers of the interval 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...…
-
3
votes2
answers194
viewsCondition to continue loop while invalid value
I wanted to know about this code: Algoritmo "Brincadeira2Ou1 " Var A, C, P: inteiro Inicio A <- 0 C <- 0 P <- 0 escreval ("(=====================2===OU===1=====================)") escreval…
-
3
votes1
answer66
viewsVisualg G Algorithm
Ask for a person’s name and sex. Present at the end how many people are male and how many are female. The program terminates when user type ORDER in person name. Can someone help me? Every time I…
-
2
votes1
answer1062
viewsvisualg ladder break line
I’m having trouble with the code to break the line. I need to create a ladder that looks like below: # ## ### #### ##### If I write ("#") it breaks the line, but the end result is like this: # # # #…
-
2
votes1
answer4995
views -
2
votes1
answer1158
viewsUsing LOG in VISUALG Functions
When using visualG LOG there is a problem, I need to divide a value typed by the user, by log 2 in base 10. Only he doesn’t make it he’s wrong. funcao menu_8():inteiro var logaritmo :real inicio…
-
2
votes2
answers776
viewsVisualg - Boolean result
I built this algorithm into Visualg: algoritmo "semnome" var inicio se 3 = "a" entao escreva("igual") senao escreva("diferente") FimSe fimalgoritmo And I don’t understand, why the condition is…
-
2
votes1
answer1731
viewsSearch repeated numbers in list with Visualg
Write a program that receives 100 numbers typed by the user. At the end the program displays how many numbers are reported equal to the last number typed. As far as I can go: algoritmo "semnome" //…
-
2
votes1
answer4196
viewsHow to save data in. txt file in Visualg?
People need to do a registration system in Portugol for a college job. However, I want the data to be saved for a possible query. There is the possibility to save data in a file . txt in Visualg? (I…
-
2
votes2
answers2462
views -
2
votes1
answer4559
viewsDivisible - Portugol (VISUALG)
I have the following question and below what I have tried but it is not just showing the divisible numbers that is my intention. I’m doing the test by typing the number 8, the correct one was for…
-
2
votes1
answer557
viewsVisual G : What does the character ' mean and how does it influence the results?
I’m learning to use the visual g through this stuff here: http://eletrica.ufpr.br/~Rogerio/visualg/Help/linguagem2.htm In this particular code I have a very small question, which contains no answers…
-
2
votes2
answers1896
viewsVisualg - Assign two variables on the same line
I would like to know how to put 1 variable next to each other in the visualg? Exemplo: 1.0 7.0 5.0 9.0 Since the 4 numbers are REAL variables, to simplify I want to write 1.0 below 5.0 ai the cursor…
-
2
votes1
answer488
viewsError in Visualg in REAL variable
In the algorithm below, visualg says: I expected REAL type expression. This always happens when I type 1.88 or any number with decimals in the variable (a). But the variable is not integer as you…
visualgasked 4 years, 6 months ago Fábio Klatt 19 -
2
votes1
answer187
viewsIs there any way to round a negative value to zero in Visualg?
I wish it were always displayed Vida: 0 in the last block, even if the value is negative, without doing that "Gambiarra" that I did just below. Is there any function around vidaInimigo, without the…
-
2
votes3
answers85
viewsWhy is my Condition Structure assigning a value to a variable?
My code below represents the scenario of keeping a feedback of 5 questions, where: Each question is worth 2 points Check if 3 students will hit the Feedback Calculate Each Student’s Individual Grade…
-
2
votes1
answer44
viewsDoubt with "minor" in Visualg
I started a course of algorithms and I like it a lot! But lately I have been quite complicated with the question of "minor" in some situations. Follows the question: Create a program that reads the…
visualgasked 3 years, 6 months ago Lucas Silva 23 -
1
votes1
answer693
viewsHow to create an undetermined algorithm using visualg?
I need to create an algorithm that returns me different values each time it is executed, even receiving the same input values. It aims to solve a question where I need to analyze the generation of a…
-
1
votes1
answer1032
viewsTest output value to check if it is INTEGER
I set the function below to check if 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])) /…
-
1
votes1
answer150
views -
1
votes1
answer862
viewsCreate algorithm that calculates LOG in visualg
I’ve been given a list of exercises to do in Visualg and I’m having doubts in one of these exercises: "Enter the number and base on which to calculate the logarithm of that number and print it." I…
-
1
votes1
answer1532
viewsHow to make a variable to store each number that a counter divides by a given number?
Let’s assume 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 I’m talking about. algoritmo "Nums primos" var N,C,TotNums : inteiro inicio C…
-
1
votes0
answers1067
viewsexercise in visualg algorithm
The cost to the consumer of a new car is the sum of the factory cost with the percentage of the distributor and the taxes, both applied to the factory cost. It is known that the percentages are the…
-
1
votes1
answer1729
viewsFinish repeat loop Repeat Visualg loop
When we use the repita along with the ate at the end of the block, we should also use the fimrepita? If not, when we use this? algoritmo "semnome" var t,n,i,m:inteiro inicio i<-0 repita escreval…
-
1
votes1
answer653
viewsVisualg algorithm: disregard number 0
I’m solving the following exercise: Write an algorithm that averages the numbers typed by the user, if they are even. Finish reading if the user type zero (0) However, when I type 0 to finish, it is…
-
1
votes2
answers157
viewsSum of numbers from right to left
I need to sum the digits of a number typed by the user. For example: If input equal to 20, make 2 + 0 = 2 If the input is 45, make 4 + 5 = 9 Visualg and C can be used.…
-
1
votes1
answer1592
viewsConvert letter by number to visualG
Is it possible to create an algorithm in visualg that reads a letter and transforms it by another letter or by a number that was already stored in the algorithm? As a simple encryption? The logic…
-
1
votes1
answer134
viewsWhy is this kind of comparison/choice wrong?
escreval("Digite o consumo") leia(consumo) escolha consumo caso <= 100 escreval("Parabéns, voce e economico") caso >=101 e <200 escreval("Cuidado com o consumo") caso >200…
-
1
votes0
answers57
viewsHelp with Visual G
I’m having a problem in Visual G. It’s a college exercise (ADS - 1st Semester). I need to create an even or odd number identifier, however, without using MOD, division or multiplication, only sum…
-
1
votes0
answers52
viewspeople someone help me with this visualg function
i am trying to use the ready functions of visualg, to read a name, tell the 3 letter code as well as show it, but the problem is this giving direct error ("this is the code of the third letter of…
-
1
votes2
answers803
viewsError in assigning a value to a variable
I’m doing some algorithms on Visualg and came across the following error: Error in assigning values to variable d: REAL to INTEGER My code is this one: Algoritmo "acertoMiseravi" d: inteiro Inicio…
-
1
votes1
answer70
viewsGives an error in the "if" but does not say which error is! visualg
algoritmo "tinder" var l, m, i, b, c, s: logico pri, seg, ter: logico andressa, monica, leticia, eduarda, maria, ana, clarisse, joana: logico inicio escreval ("----------------------------------")…
visualgasked 6 years, 7 months ago Filipe Fernandes 23 -
1
votes1
answer444
viewsAge accountant
Good afternoon guys, all right? I have an exercise here from the Faculty of Algorithms I, follow the statement below: Write an algorithm that asks for the age of several people (USE REPEAT). Please…
visualgasked 6 years, 6 months ago tspereirarj 49 -
1
votes1
answer941
viewsVisualg - Prog for limits
I am doing the program of the following exercise: Create an algorithm that reads the lower and upper bounds of a range and print all odd numbers in the open range and its sum (USE THE FOR). Suppose…
-
1
votes2
answers679
viewsIs it possible to pass a vector as a parameter in Visualg?
Is it possible to pass a vector as a parameter in Visualg? If yes, which methods should be used?
-
1
votes1
answer420
viewsCan you tell the size of an array in Visualg?
para i de 1 ate array.length faca escreval("Falta ", i, "?") leia(falta[i]) i <- (i + 1) fimpara For example, in Java it is array.length.…