using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
//int i, j;
//for (i = 0; i < 4; i++)
//{
// for (j = 4; j > i; j--)
// {
// System.Console.Write("*");
// }
// System.Console.WriteLine();
//}
//System.Console.ReadLine();
////////// for checking palindrome no......
//System.Console.WriteLine("Please enter any no to check wheather it is palindrome or not?");
//int i, j, k, l;
//l = 0;
//string s = System.Console.ReadLine();
//i = Convert.ToInt16(s);
//j = i;
//while (i != 0)
//{
// k = i % 10;
// l = l * 10 + k;
// i = i / 10;
//}
//if (j == l)
//{
// System.Console.WriteLine("Its is palindrome no");
//}
//else
//{
// System.Console.WriteLine("it is not palindrome");
//}
//System.Console.ReadLine();
///////////for armestrong no;;;;
//System.Console.WriteLine("Please enter any no to check wheather it is armestrong or not?");
//int i, j, k, l;
//l = 0;
//string s = System.Console.ReadLine();
//i = Convert.ToInt16(s);
//j = i;
//while (i != 0)
//{
// k = i % 10;
// l = (l + k * k * k);
// i = i / 10;
//}
//if (j == l)
//{
// System.Console.WriteLine("Its is armestrong no");
//}
//else
//{
// System.Console.WriteLine("it is not armestrong");
//}
//System.Console.ReadLine();
int i, j;
int fib=1;
i = -1;
j = 1;
int n = 50;
while (fib <= n)
{
fib = i + j;
i = j;
j = fib;
System.Console.WriteLine(fib.ToString());
}
System.Console.ReadLine();
}
}
}
1 comment:
Genius Blog..
Post a Comment