Physics, asked by arre29, 10 months ago

write a program to find the series upto 10 terms:
7,12,17......................................

Answers

Answered by Anonymous
8

import java.util.*;

public class Series

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

int a=5;b,i;

//using for loop

for(i=1;i<=10;i++)

{

b=a*i+2;

System.out.println("The series is"+ b);

}

}

}

Answered by Anonymous
3

import java.util.*;

public class Series

{

public static void main(String args[])

{

//Since there is no need of taking any input so we can ignore the scanner class but it is essential while there is the need of taking any input

int n=5,m=3,s,c;

//using for loop as the program needs to be repeated again and again

for(c=1;c<=10;c++)

{

//the mathematical expression should be

s=n*c+m;

}

}

}

Similar questions