Write the programs in Java to display the first ten terms of the following series: 0, 1, 2, 3, 6, ................
Answers
Answered by
41
Explanation:
class series
{
public static void main(String args[])
{
int i,d=0,a=-1,b=2,c=-1;
for(i=1;i<n;i++)
{
d=a+b+c;
if(i>1)
{
System.out.print(d+" ");
}
a=b;
b=c;
c=d;
}
}}
pls mark me brainliest
Similar questions
Science,
5 months ago
Social Sciences,
5 months ago
India Languages,
5 months ago
Math,
10 months ago
Science,
10 months ago
Physics,
1 year ago
Geography,
1 year ago