Possible Duplicate:
Why are we using i as a counter in loops
I've used these myself for more than 15 years but cannot really remember how/where I picked up that habit. As it is really widespread, I'm curious to know who originally suggested / recommended using these names for integer loop counters (was it the K&R book?).
(From: Why are we using i as a counter in loops)
Obviously,
j
andk
are just the next ones in your favorite alphabet.FORTRAN. If the first character is I, J, K, L, M or N, the variable is integer (i.e. can hold a whole number value). Otherwise, it is real (i.e. can hold a value according to the floating point convention).
I always thought i stands for index as used eg in sum formulas in mathematics.
The Mathematicians :)
From the wikipedia for Loop Counter
It's common from school-level and college-level algebra exercises (although
x
andy
had their part to play, there, too :-)Also, if I remember correctly, the early programming languages (like early versions of
FORTRAN
) used variable naming in a way where initial letters were significant, and this may have had a part to play. For example, as this page says: