write a program to generate a pell series upto 16 terms
Answers
Answered by
2
import java.util.Scanner;
public class Example25 {
public static void main(String args[])
{
int n,a=1,b=0,c;
System.out.println("First 20 Pell numbers: ");
for(n=1; n<=20; n++)
{
c= a + 2*b;
System.out.print(c+" ");
a = b;
b = c;
}
}
}
Similar questions
Social Sciences,
4 months ago
Physics,
4 months ago
Physics,
9 months ago
Math,
1 year ago
Math,
1 year ago