Read wiki for the formula:
http://en.wikipedia.org/wiki/Fibonacci_number
Write your homework code in VB yourself.
2006-12-16 17:01:04
·
answer #1
·
answered by alakit013 5
·
0⤊
0⤋
gah, sorry, but my BASIC syntax is about 20 years old... Here it is in C, take it from there:
void main( int argc, void *args[] )
{
int v1, v2;
int cur;
v1 = 1;
v2 = 1;
printf( "%d\n", v1 );
printf( "%d\n", v2 );
for ( int i = 0; i < 100; i++ )
{
cur = v1 + v2;
printf( "%d\n", cur );
v1 = v2;
v2 = cur;
}
// This will print out the first 102 fibonacci nums
}
2006-12-17 02:10:42
·
answer #2
·
answered by TankAnswer 4
·
0⤊
0⤋
if this is for you programming class and you can't program a fib problem, you're in big trouble. Use google next time.
http://www.codeguru.com/forum/showthread.php?t=402914
2006-12-17 01:06:29
·
answer #3
·
answered by SlyMcFly 4
·
0⤊
0⤋