Ruby
xxxxxxxxxx
first=0
second=1
nextterm=0
puts "Enter the number of terms:-"
n=gets.chomp.to_i
puts "The first #{n} terms of Fibonacci series are:-"
c=1
while(c<=n+1)
if(c<=1)
nextterm=c
else
puts nextterm
nextterm=first+second
first=second
second=nextterm
end
c+=1
end
Enter the number of terms:- 15 The first 15 terms of Fibonacci series are:- 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610
Linux - anc-api-tools ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - curvedns ని ఎలా ఇన్స్టాల్ చేయాలి
Python - సంఖ్య సానుకూలంగా ఉందా, ప్రతికూలంగా ఉందా లేదా 0 అని తనిఖీ చేయండి
Linux - zenmap ని ఎలా ఇన్స్టాల్ చేయాలి
C - పూర్ణాంకంలో అంకెల సంఖ్యను లెక్కించండి
C++ - లీప్ ఇయర్ని తనిఖీ చేయండి
JavaScript - స్ట్రింగ్ కొన్ని అక్షరాలతో ప్రారంభమై ముగుస్తుందో లేదో తనిఖీ చేయండి
C++ - సంఖ్య ప్రధానమైనదా కాదా అని తనిఖీ చేయండి
C - డైనమిక్ మెమరీ కేటాయింపును ఉపయోగించి అతిపెద్ద సంఖ్యను కనుగొనండి
Kotlin - ఒక సంఖ్యను రివర్స్ చేయండి
Kotlin - ఒక సంఖ్యను n దశాంశ స్థానాలకు రౌండ్ చేయండి
Linux - xbitmaps ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - zstd ని ఎలా ఇన్స్టాల్ చేయాలి
Java - ఒక సంఖ్యను రివర్స్ చేయండి
Linux - zfs-test ని ఎలా ఇన్స్టాల్ చేయాలి
Python - Excel (XLSX) ఫైల్లను వ్రాయడం
C++ - కోషెంట్ మరియు రిమైండర్ను కనుగొనండి
Linux - zookeeper-bin ని ఎలా ఇన్స్టాల్ చేయాలి
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month