Here's what i would have done:
Hope that helps you.Code:int A( int n ) { int i, x, y = 2, z = 1; if( n <= 1 ) x = n+1; else for( i=2; i<=n; i++ ) { x = 2*y - 3*z; z = y; y = x; } return x; }
Here's what i would have done:
Hope that helps you.Code:int A( int n ) { int i, x, y = 2, z = 1; if( n <= 1 ) x = n+1; else for( i=2; i<=n; i++ ) { x = 2*y - 3*z; z = y; y = x; } return x; }
Loading.....
( Trying to be a good C Programmer )