Print the following series with for loop
1,2,4,7,11...........first 10terms
Answers
Answered by
11
class series
{ public static void main( )
{
int a =1,c=1;
for (int i =1 ;i<=10;i++)
{System.out.print( a +",");
a= a+c;
c++;
}
}
}
{ public static void main( )
{
int a =1,c=1;
for (int i =1 ;i<=10;i++)
{System.out.print( a +",");
a= a+c;
c++;
}
}
}
Similar questions
Computer Science,
7 months ago
Math,
7 months ago
Physics,
1 year ago
English,
1 year ago
Chemistry,
1 year ago