Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Why is it called a 'for' loop?

+12 votes
I realize this question is pretty irrelevant, but i am just asking out of curiosity.
asked Nov 25, 2015 in (Winter 15-16) by Liem Gearen (100 points)

2 Answers

+2 votes
Best answer

Think of FOR as a shorthand for something like this...

"FOR each value of some variable starting at ___ and going up (or down) to ____, run the following code that's in { } braces"

answered Nov 29, 2015 by Forrest Stonedahl (100 points)
selected Nov 30, 2015 by Liem Gearen
+3 votes
for loop repeats a specific block of code several number of times and increases its specified value each time for its given condition hence it is called a for loop
answered Nov 25, 2015 by Raisha Shrestha (100 points)