i am new to java..
can someone help me with a program that displays fibonacci series ..when limit is mentioned ?
Printable View
i am new to java..
can someone help me with a program that displays fibonacci series ..when limit is mentioned ?
Yeah we can, but first you need to show us what you've done so far and what problems you're having.
Is this the same problem that you posted on another forum?
some code explanation please?
Please provide a link to the other forum so people here can see what has been answered already for this question.
this is fibonacci.. the other was factorial..lol ..infact i have a total of 18 problems to solve and study..i was wondering where i could ask about all these..
Quote:
import java.io.*;
class fibonacci
{
int first,second,third,lim;
string n1;
System.out.println("\n enter the limit");
BufferedReader in = new BufferedReader (new InputStreamReader(System.in));
n1 = in.readLine();
lim = Integer.parseInt(n1);
first=0;
second =1;
for (int i = 1; i<=lim; i++)
{
System.out.println(first);
third=first +second;
first = second;
second= third;
}
}
}
Can you post the program's output and explain what is wrong with it?
thats not what i am worried about.. i cant make sense of the logics behind these.. all i could do is byheart these codes for the exam.. speaking about these helps me a bit...
i have a palindrome problem.. a problem to find the area of a circle using interface... i dont even know what an interface is..
is it ok to post the rest of the problems here ?
i might be able to correct atleast syntax errors by having a little discussion about it
Work on one problem at a time.
What happens when you compile and execute the code you posted in post#4?