Write a JAVA program to display the sum of the series : 1 + 12 + 123......n terms
Answers
Answered by
1
Explanation:
Print Series 1, 12, 123, 1234, …………n in Java.
public class Series.
public static void main(String args[])
int n = sc.nextInt();
int s = 0, c; // s for terms of series, c for counter to generate n terms.
for (c = 1; c <= n; c++) {
Similar questions