Print Fabinacii series Using Array:
int a[]={10,13,12,15};
int first=0;last,result;
for(int i=0;i<a.length;i++)
{
last=a[i];
result=last+fisrt;
first=result;
console.writeline(result);
}
print from 1 to 10 fabinacii numbers:
result=0;last=1;
for(int i=0;i<10;i++)
{
result=first+last;
last=result;
first=last;
Console.WriteLine(result);
}
int a[]={10,13,12,15};
int first=0;last,result;
for(int i=0;i<a.length;i++)
{
last=a[i];
result=last+fisrt;
first=result;
console.writeline(result);
}
print from 1 to 10 fabinacii numbers:
result=0;last=1;
for(int i=0;i<10;i++)
{
result=first+last;
last=result;
first=last;
Console.WriteLine(result);
}
No comments:
Post a Comment