# VBForums CodeBank > CodeBank - C++ >  Fibonacci

## dday9

The following is a code snippet representing the Fibonacci number:


```
int fibonacci(int value) {
	if (value < 0) {
		return -1;
	} else if (value == 0) {
		return 0;
	} else if (value < 2) {
		return 1;
	} else {
		return fibonacci(value - 1) + fibonacci(value - 2);
	}
}
```

It will return a -1 for any numbers less than 0.

----------

