Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package helloworld;
- import java.io.*;
- import java.util.Scanner;
- /**
- * @author pradeep_7
- */
- public class Helloworld {
- public static void main(String[] args)throws IOException {
- Scanner hello = new Scanner(System.in);
- int a=0,b=1,c=0,n,i;
- n= hello.nextInt();
- System.out.print(a+" "+b);
- for(i=2;i<n;i++)
- {
- c=a+b;
- a=b;
- b=c;
- System.out.print(" "+c);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement