(1)febonocci serise
class Mittu
{
public static void main(String []args)
{
int i,x=0,y=1,z,n=10;
System.out.println("febonocci serise is");
System.out.println(x);
System.out.println(y);
for(i=2;i<n;i++)
{
z=x+y;
System.out.println(z);
y=x;
x=z;
}
}
}
output
febonocci serise is0
1
1
1
2
3
5
8
13
21
No comments:
Post a Comment