Questions tagged as 'bucle-for'

4
answers

How to perform mathematical operations with the values of an array

I have a problem subtracting the values of an array from one another. The sum works perfectly, but the subtraction does not work. It always makes me negative numbers, and that would not be the case. This is my code: var numbers = []; var u...
asked by 17.06.2018 / 13:01
2
answers

trying to generate a fibonacci sequence 0,1,1,2,3,5,8,13,21,34 with for loop and without the final comma

This is my code, if I do not put conditions I get everything but I add a final comma and trying to filter the last position of i with an if () omits the last two numbers. public class EjercicioFibonacci { public static void main(String[] a...
asked by 27.05.2018 / 16:25
1
answer

Problem with FOR loops

I'm trying to simplify the content of the movement function () to two loops, but doing it in loops does not do anything to me. My code is as follows: int movimimiento(){ mueve_servo(&patas[1][1], mov_home[1][1]); mueve_servo(&p...
asked by 11.11.2018 / 22:00
3
answers

In java the integer data types are applicable in the for each loop?

I have searched for examples to understand the for each loop and most examples only show using the type String for example declare a array type String and then use the loop for each . Well, the point is that...
asked by 05.09.2017 / 08:51
1
answer

C ++ fix problem

I am entering by passing a char to an array of char and when inserting it does it well, as I enter and print everything from little to little. Then I made another for to show only the arrangement and it turns out that onl...
asked by 02.11.2018 / 21:18
1
answer

Problem with for (cursor) and if linked Oracle PL / SQL procedure

What I intend is to create a procedure that updates the sale price of a piece whose price is passed by parameter, this will be done only if the new price is greater than the existing one in the database. For now I want to do it without exception...
asked by 12.05.2018 / 16:58
1
answer

JAVA - Netbeans - FOR Cycle

I'm starting in java language, with netbeans. I do some exercises, I just can not understand how the next cycle works: if (num<=1){ return false; }else{ int prueba; int contador=0; prueba=(int)Ma...
asked by 08.12.2018 / 17:28
1
answer

Explanation java code

import java.io.*; import java.util.*; public class E11 extends Thread { public void run() { ArrayList<Integer> primos = new ArrayList<Integer>(); boolean primo = true; for (int i = 1; i <= 100; i++) { for (Inte...
asked by 05.12.2018 / 19:35
1
answer

save data in an array with js

I have two variables with their respective values: lat = ["-100.41812896728515","-100.41812896728517","-100.41812896728519"] lng = ["20.62346622550882","20.623466225508828","20.623466225508828"] What I want is to unite both that is...
asked by 27.12.2018 / 18:17
1
answer

Restart in cycle for

I am doing a program which reads a file (which contains in lines words, is attached) and has to return a new file with the word in question and the sum of its characters (these I generated from a dictionary ). The problem is that it does everyth...
asked by 19.11.2018 / 20:51