+ 1
my code outputs only the last information in the loop . what can be the problem
3 Answers
+ 2
Post your code here.
+ 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
0
send your code please