+ 1

my code outputs only the last information in the loop . what can be the problem

20th Sep 2016, 6:25 PM
Issah
Issah - avatar
3 Respuestas
+ 2
Post your code here.
20th Sep 2016, 6:35 PM
Cohen Creber
Cohen Creber - avatar
+ 1
maybe you are printing the result out of the loop i.e your code just output the last result after the loop ends, as given below- for (int i=0;i<x;i++) { do something 'x' times } print (i); //should be written in the loop to print 'i' each time the loop is executed
20th Sep 2016, 6:47 PM
Yogendra Bist
Yogendra Bist - avatar
0
send your code please
21st Sep 2016, 1:58 AM
Antonio Gallimore
Antonio Gallimore - avatar