Write a program to find the following series upto 10 terms:
6,16,26.........................
Answers
Answered by
2
/*Observe the program, there is no condition of taking input so, we should not use the scanner class, but, scanner class is very much important while there is any such case of taking input*/
/*watch the sequence of the program carefully, its showing the multiplication table of 10 with multiple subtracted by 4, such that,
10*1-4=10-4=6
10*2-4=20-4=16
10*3-4=30-4=26 and so on*/
//now come to the point of program
//using the utilizing process
import java.util.*;
public class Series
{
public static void main(String args[])
{
//As scanner class is not necessary so directly declairing the variables
int m=10,n;
//using for loop to terminate the program
for(n=1;n<=10;n++)
{
m=m*n-4;
System.out.println("The series is"+m);
}
}
}
Similar questions
Math,
5 months ago
Math,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Economy,
10 months ago
Computer Science,
1 year ago
Science,
1 year ago