#include using namespace std; /* * Recursive routine to compute sum of first n integers. */ long s( int n ) { if( n == 1 ) return 1; else return s( n - 1 ) + n; } int main( int argc, char *argv[] ) { for( int i = 1; i < 10; i++ ) cout << s( i ) << endl; return 0; }