Questions tagged as 'loop'

4
answers

Repeat Loop in C

Hello, I'm a beginner in programming and I have a question: I'm doing a program that has a menu and a register to be performed by the user. I would like to know how to make the program menu always appear after finishing the registration, instead...
asked by 29.09.2017 / 02:25
3
answers

Creating html elements in looping javascript

I'm pretty new with javascript and when it comes to creating loopings I totally lose myself, the code below is to create the elements with each click and number the id and the text, but I'm having difficulties with that, I I managed to so...
asked by 06.08.2018 / 18:24
2
answers

Total sum of a loop

I'm trying to make a total sum of a "for" but everything is very crazy or "zeroed" ... <?php for ($i=0; $i < count($data); $i++) { $total_receitas_recebidas = 0; $total_receitas_a_receber = 0; $total_despesas...
asked by 05.03.2018 / 15:08
3
answers

Error calculating a loop value

#O usuário informa o número de alunos totais na sala, em seguida são declaradas as variáveis que complementarão os loops alunos = int(input("Qual o número de alunos na sala?\n")) notasAlunos = [] count = 0 #loop de armazenamento de notasXalunos w...
asked by 27.03.2018 / 21:39
1
answer

Insert a loop into another loop

I want to intersperse the second with the first. For illustration, I will use the simple example below as a basis: <script> n = 10; for ( var i = 0; i < n; i++){document.body.innerHTML += i;} for ( var i = 0; i < n; i++){...
asked by 09.04.2016 / 05:19
2
answers

Incorrect Print Values

I do not know where I'm going wrong and are printing incorrect media values. #include <stdio.h> int main (){ int i, num, soma, maior, menor; float media; printf ("Informe 10 valores:\n"); for (i=1; i<=10; i++){ scanf ("%d", &...
asked by 23.10.2017 / 20:05
2
answers

How to relate two lists, getting the value of one through the maximum of the other?

I am stuck in an exercise that asks for an X number of teams participating in a championship. In the later lines the team name and its score are entered. On the way out, the team that scored the most and the average. My current code is: num...
asked by 24.10.2018 / 21:09
2
answers

"for" with step "float": TypeError: 'float' object can not be interpreted as an integer

I want to loop from 0 to 100 with step 0.1: for x in range(0, 100, 0.1): a = cos(radians(x)) But I get this error:    TypeError: 'float' object can not be interpreted as an integer How can I loop through step float?     
asked by 08.10.2018 / 20:06
2
answers

Handling items during iteration

In Python it is somewhat common to go through items from an iterable handle or checking for the existence of a particular item, or whatever the operation. I'm reading the Python documentation again and I come across something that when seen fo...
asked by 20.11.2018 / 23:47
2
answers

Problem with vector ordering [closed]

Good afternoon, I'm having a problem with a vector ordering exercise, I have already reviewed the code, it compiles, but I'm not finding the error for the order not to stay increasing, varying in certain passages. Here is the code: #include &l...
asked by 12.04.2015 / 20:17