Friday, November 29, 2013

Confusing Fibonacci series

fibonacci series :
As per interview point of view,I have experienced the Fibonacci series is quite torturing,there is no doubt that you will answer but thinking and writing ,taking time will affects your performance.

I am showing you the best way to remember:
c = a+b;
a = b;
b = c;

Now see the code:
int a =0;int b=1;int c;
Response.Write(a+"<br>");
Response.Write(b+"<br>");
for(int i=0;i<=100;i++)
{
c = a+b;
a = b;
b = c;
Response.Write(c+"<br>);"

hope it makes you to remember & pen down fibonacci easily..

No comments: