Asp . Net || SQL Server
Saturday, 17 January 2015
Fibonacci Series using C #
Fibonacci Series using C #
public static void main ()
{
int num , a =0 , b=1 , c= 0;
Console.Writeline("Enter a number :");
num = int.parse(Console.ReadLine());
Console.Write("{0}{1}",a,b);
for(i=2 ; i<num ; i++)
{
c= a+b;
Console.Write("{0}",c);
a=b;
b=c;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment