public class fibonacci
{
public static void rmkp(int n)
{
int a = 0;
int b = 1;
int c;
int i= 3;
System.out.print(a +" "+ b + " "+ " ");
while( i <=n)
{
c = a + b;
System.out.print(c);
a = b;
b = c;
i++ ;
}
}
}
{
public static void rmkp(int n)
{
int a = 0;
int b = 1;
int c;
int i= 3;
System.out.print(a +" "+ b + " "+ " ");
while( i <=n)
{
c = a + b;
System.out.print(c);
a = b;
b = c;
i++ ;
}
}
}
No comments:
Post a Comment