Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- int prev = 0;
- int curr = 1;
- int next;
- int i = 0;
- while (i < 10)
- {
- System.out.println(curr + " ");
- next = prev + curr;
- prev = curr;
- curr = next;
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement