I'm confused from reading your question also, but. . . I think you are referring to the mathematical term "Summation" (which uses the Greek letter Sigma). Summation uses recursion which is illustrated in Bruce Eckel's Thinking in C++ tutorial as:
void removeHat(char cat) {
for(char c = 'A'; c < cat; c++)
cout << " ";
if(cat <= 'Z') {
cout << "cat " << cat << endl;
removeHat(cat + 1); // Recursive call
} else
cout << "VOOM!!!" << endl;
}
|