C Sharp is usually known as C#. This Language is basically the Programming Language which is mainly used for object orientation. this language was developed by Microsoft. i personally feel that many people face problem while writing such codes for particular program.
Question:
Make a Program in which you make Fibonacci series by input values.
{
int limit;
Console.WriteLine("Enter value of Series : ");
limit = Convert.ToInt32(Console.ReadLine());
if(limit==0)
{
Console.WriteLine("The Seires will be 0");
}
else if(limit==1)
{
Console.WriteLine("The Seires will be 0");
}
else if(limit==2)
{
Console.WriteLine("The Seires will be 0, 1");
}
else if(limit>2)
{
int num0 = 0, num1 = 1, i=3, num2;
Console.Write("The Seires will be 0, 1, ");
while(i<=limit)
{
num2 = num0 + num1;
Console.Write(num2+ ", ");
num0 = num1;
num1 = num2;
i++;
}
}