Computer Science, asked by vikashshardhap985o7, 1 year ago

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 arjungupta2908p98jq2
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;
            }
        }
    }
}



vikashshardhap985o7: Thank you man...
arjungupta2908p98jq2: welcome :)
Similar questions