Write a program to print the following series.
2 4 7 9 12 14 17 19 22 24... using for loop in any computer language
Answers
Answered by
1
Hey!Here's you answer:-
class abc
{
void a()
{
int n=10;
int a=2;
for(int i=1;i<=n;i++)
{
System.out.println(a);
if(i%2==0)
{
a=a+3;
}
else
{
a=a+2;
}
}
}
}
class abc
{
void a()
{
int n=10;
int a=2;
for(int i=1;i<=n;i++)
{
System.out.println(a);
if(i%2==0)
{
a=a+3;
}
else
{
a=a+2;
}
}
}
}
vikashshardhap985o7:
Thank you man...
Similar questions