i am new to java..
can someone help me with a program that displays fibonacci series ..when limit is mentioned ?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
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.
Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code
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.
newbie (December 31st, 2011)
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..
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;
}
}
}
Last edited by javawreker; January 1st, 2012 at 03:28 AM.
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?