answersLogoWhite

0


Best Answer

Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

The last digit in the number 'N' is

[ N ] minus { 10 times [ the greatest integer in (N/10) ] }.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a java program to print the last digit in Fibonacci series?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How to write a java program to extract the last digit from the input?

Assuming you've entered a multi-digit number whole number (an integer), then take the modus (%) of the number and 10. E.g., if the number input was 1234, then 1234 % 10 is 4. Thus the final digit is 4. Note that modus 10 is the same as dividing the number by 10 and taking the remainder.


Java script program to Print the Fibonacci series using array?

<script type = "text/javascript"> var input; var rev = 0; input=window.prompt ("Please enter a 5-digit number to be reversed."); input = input * 1; while (input > 0) { rev *= 10; rev += input % 10; input /= 10; } document.write ("Reversed number: " + rev); </script>


How do you write a visual basic program to sum the odd number digits of a 12 digit code using division and Mod and while loops?

Function sum_odd_digits(ByVal number As Integer) As Integer Dim digit As Integer sum_odd_digits = 0 While number <> 0 digit = number Mod 10 If digit And 1 Then sum_odd_digits = sum_odd_digits + digit number = number / 10 End While End Function


Write a C program to find out whether character passes through keybroad is a digit or not?

hey..it s simple..make use of built-in function isdigit(character)..it s in stdlib.h...


How do you write a Java program to accept a 3-digits integer number and print out the highest digit from the derived input?

The tricky part is getting the individual digits. There are basically two ways to do this: 1) Convert the number to a string, and use string manipulation to get the individual digits. 2) Repeatedly divide the number by 10. The digit is the remainder (use the "%" operator). To actually get the highest digit, initially assume that the highest digit is zero (store this to a variable, called "maxDigit" or something similar). If you find a higher digit, replace maxDigit by that.

Related questions

Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


What is the first 4 digit number in the Fibonacci sequence?

The first four-digit Fibonacci number is 1597 - equal to 610 + 987.


What is the first five digit number in the Fibonacci sequence?

10946


What three things are Mr Fibonacci most famous for?

He helped to popularize the 0-9 digit number, came up with the Fibonacci sequence and the sub-set of Fibonacci primes.


What is next to number series 15 225 3325 44325 5?

next number to this series is 554325. its look like this 15--add 1 to first digit and we get 2 and repeat two times and leave other digit.225 225-- its first digit is 2 and add 1 to it get 3 and write two time and write remaining digit as 3325. 3325-- its first digit is 3 and add 1 to it get 4 and write two time and write remaining digit as 44325. 44325-- its first digit is 4 and add 1 to it get 3 and write two time and write remaining digit as 554325.


Is the number 8 a palindrome or Fibonacci sequence?

Any single digit number is a palindrome. The Fibonacci sequence consists of infinitely many numbers so 8, being only one number, cannot be the Fibonacci sequence.


What is SAP give you the brief solution?

Write a program to convert a 2-digit BCD number into hexadecimal


How do you Write a program that determines the number of occurrences of each digit in a given integer n?

there could be a part in it like this: int num, digit; int count [10]; do { digit = num%10; num != 10; ++count[digit]; } while (num);


How to write a java program to extract the last digit from the input?

Assuming you've entered a multi-digit number whole number (an integer), then take the modus (%) of the number and 10. E.g., if the number input was 1234, then 1234 % 10 is 4. Thus the final digit is 4. Note that modus 10 is the same as dividing the number by 10 and taking the remainder.


Java script program to Print the Fibonacci series using array?

<script type = "text/javascript"> var input; var rev = 0; input=window.prompt ("Please enter a 5-digit number to be reversed."); input = input * 1; while (input > 0) { rev *= 10; rev += input % 10; input /= 10; } document.write ("Reversed number: " + rev); </script>


What is the smallest 5 digit number you can write?

The smallest 5 digit number you can write is 10000.