Nevermind, I got it working. Didn't think to use an array; well I thought about it, but didn't think it would make the problem easier. Here's my fibonacci sequence, written iteratively.
#include <iostream>
using namespace std ;
int main ( )
{
int fibArray[25] ; //max fib number
fibArray[0] = 1 ;
fibArray[1] = 1 ;
for ( int i = 2 ; i < 25 ; i ++ )
fibArray[ i ] = fibArray[ i - 1 ] + fibArray[ i - 2 ] ;
cout << fibArray[4] << "\t" << fibArray[7] << "\t" << fibArray[24] << endl ;
return 0 ;
}
It is practically impossible to teach good programming style to students that have had prior exposure to Basic; as potential programmers they are mentally mutilated beyond hope of regeneration.
-Edsger Dijkstra