Saliya's Blogs

Mostly technical stuff with some interesting moments of life

Showing posts with label non recursive. Show all posts
Showing posts with label non recursive. Show all posts

Fibonacci Calculator in Visual C++

#include "stdafx.h"
#include

using namespace std;

int calculate_fibonacci(int n);

int main(int argc, char* argv[])
{
int n;
cout << "Enter n: "; cin >> n;
cout << "Fibonacci of " << int="" b="1," bb="0," return="" else="" if="" n="="> 1) {
for (i = 1; i < result =" 0;" bb =" b;" b =" result;">