I am trying to to write a program that will print the first 15 Fibonacci numbers each on one line with to lessons (print and produce)
the code that I have is below:
class numbers{
static int numbers[] = new int[15];
public static void produce(int Fib){
if(Fib < 2)
numbers[n] = n;
else
numbers[n] = numbers[n-1] + numbers[n-2];
}
public static void print(){
for(int k = 0; k < 15; k++)
System.out.prin tln(numbers[k]);
}
public static void main(args[0]){
for(Integer i = 0; i < 15; i++)
produce (i);
print ();
}
the errors are
1) public static void main(args[0])
telling me an error under the "0"
and the other is I am missing and indentifier
the code that I have is below:
class numbers{
static int numbers[] = new int[15];
public static void produce(int Fib){
if(Fib < 2)
numbers[n] = n;
else
numbers[n] = numbers[n-1] + numbers[n-2];
}
public static void print(){
for(int k = 0; k < 15; k++)
System.out.prin tln(numbers[k]);
}
public static void main(args[0]){
for(Integer i = 0; i < 15; i++)
produce (i);
print ();
}
the errors are
1) public static void main(args[0])
telling me an error under the "0"
and the other is I am missing and indentifier
Comment