Questions tagged as 'for'

1
answer

Variable with unassigned value within a FOR Loop

int i; string cpf; cpf = "11111111111"; DbConnection cnx = ADO_Utils.GetConnection(); DbCommand cmd = ADO_Utils.GetComando(cnx); cmd.CommandType = CommandType.Text; for (i = 1; i < Convert.ToInt32(txbQtde.Text); i++...
asked by 21.04.2016 / 03:59
1
answer

Extracting data from a data frame in R

I have a date frame in R and the table has row sets with the same attribute (name of an instance) and with different columns with data about each instance. INSTÂNCIA VALOR 1 VALOR 2 Instancia 1 10 20 Instância 1 34...
asked by 03.12.2018 / 16:00
3
answers

How to reference the first loop from the second in a looping of loops?

In PHP, how can I reference the first for from the second, as in the example below? for ($i=0; $i < 10; $i++) { for ($j=0; $j < 10; $j++) { // Quero que esse afete o primeiro 'for' e não o segundo if ($j ==...
asked by 09.08.2017 / 19:01
1
answer

Loop is within loop for

for(pass = 0; pass < size - 1; pass++){ for(j = 0; j < size - 1; j++){ if(array[j] > array[j + 1]){ swap( &array[j], &array[j + 1]); } } } I just put a piece of code where I have a doubt...
asked by 18.01.2017 / 03:08
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
2
answers

Using For in Python

In Python it is only possible to work with 'for' (loop ) using a list? Is not it possible only with an integer like in other languages?     
asked by 15.11.2016 / 03:17
1
answer

I can not display the names of people over the age of 18

/*Escreva um programa que receba o nome, profissão e a idade de 10 pessoas, calcule e imprima a quantidade de pessoas maiores de idade (idade >= 18 anos) e seus respectivos nomes.*/ #include <iostream> #include <locale.h> #include...
asked by 31.10.2015 / 18:17
1
answer

Why does the for-loop convert from Date to integer?

Does anyone know how to explain why for-loop objects are Date converted to integer ? In the code below I want to iterate in dates but these are converted to integers. > dates <- Sys.Date() + 1:10 > dates [1] "2015...
asked by 29.09.2015 / 03:25
1
answer

For in VBA Matrix

I have a database composed of two vectors: u=(a,b,c) and v=(1,2,3) In another worksheet, I have two blank vectors x and y . I need to complete the input of x (from u ), the code returns the corresponding e...
asked by 01.07.2015 / 02:04
0
answers

How do I separate my arrays by index?

The text boxes corresponding to the number entered by the user are generated, each text box is accompanied by several checkboxes to choose the type of text. But it goes like this: Array ( [0] => 0 ) object(ElementosDTO)#7 (2) { ["t...
asked by 05.09.2017 / 19:34