Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fibonacci with Given Length
using System; namespace Rextester { public class Program { public static void Main(string[] args) { //int length = 10; int length = int.Parse(Console.ReadLine()); int firstNum = 0; int secondNum = 1; int thirdNum = 1; Console.Write(firstNum + " "); Console.Write(secondNum + " " ); //Console.WriteLine(thirdNum); for (int i = 0; i < length - 2; i++) { thirdNum = firstNum + secondNum; firstNum = secondNum; secondNum = thirdNum; Console.Write(thirdNum + " "); } } } }
run
|
edit
|
history
|
help
0
test
Math 9.4
patient portal
How to find the first index of a sub-string in a given string?
How to find the first index of a sub-string in a given string
Root
asdfghjujytgrf
test
Swap adjacent Elements
Remove Duplicate characters from String