Computer Science, asked by akhilmh, 1 year ago

Fibonacci series . what is the source code

Answers

Answered by vishakha201
1
class program
{
static void main
{
int i i,a=0,b=1,c;
System.out.print(a+" "+b);
for i=1;i<=n;i++;
{
c=a+b;
System.out.print(" "+c);
a=b;
b=c;
}
}
}
hope it helps u it is the full java program nd it is right nd if u want QBasic program then u can ask me..
nd plzzz mark me as brainlist

Rajdeep11111: This has a logical error madam.

You forgot to initialize the value of c, which should be zero (0).

Otherwise the addition won't happen
vishakha201: ohk
vishakha201: but maine ise run kiya tha tb to shi nikla tha
Rajdeep11111: No madam.

Moreover, there is a syntax error too.

Check that while variable declaration, you wrote int i i.
Similar questions