0
Java beginner test
Write a program that displays the Fibonnaci sequence up to a number N read from the keyboard. N = 20 0112358 13 Write a program that checks if a word is a palindrome.
3 Respostas
+ 7
Mohamed Amandar ,
it is not quite clear what your question or issue is. you are asking about fibonacci series, and also about palindromes. these are different items that shoulb be handled in different threads.
> for both of your requests we need to see your code to see where your issue is.
> put the code in playground, save it there, create a link to it and post it here.
+ 5
us giving you the code will not help you learn. You have to do it yourself.
We can help you fix mistakes, but you have to make those mistakes yourself.
The more mistake, the more you learn.
0
import java.util.*;
public class Fibo
{
public static int ser(int num)
{
int numm=num;
int first=0;
int sec=1;
System.out.println(first +"\n" +sec);
for(int i=0;i<=numm;i++)
{
int fib=first+sec;
first=sec;
sec=fib;
System.out.println(fib);
}
return 0;
}
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter number");
int num=scan.nextInt();
ser(num);
}
}