Write a Java program to print the following series:
0,1,2,3,6
Print 20 number in the series
gabbarhere:
hlo
Answers
Answered by
5
public class Tribonacci
{
public static void main ( String args [ ] )
{
int a = 0 , b = 1 , c = 2 , d = 0 ; System.out.print ( a + " " + b + " " + c ) ;
for ( int i = 1 ; i < = 20 ; i ++ )
{
d = a + b + c ;
System.out.print ( " " + d ) ;
a = b ;
b = c ;
c = d ;
}
}
}
Answered by
0
Answer:
Write a Java program to print the following series:
0,1,2,3,6
Print 20 number in the series
Similar questions
English,
2 months ago
English,
2 months ago
Math,
5 months ago
Social Sciences,
5 months ago
CBSE BOARD X,
11 months ago
English,
11 months ago