Computer Science, asked by kavyansh306a, 8 months ago

Write a program in java to print series: 1, (1+2), (1+2+3)...n terms.

Answers

Answered by kashishmaurya54
0

Answer:

sorry mate I don't know.........

Answered by Anonymous
1

Sample Solution:

Sample Solution:Java Code: import java.util.Scanner; public class Example25 { public static void main(String args[]) { int n,a=1,b=0,c; System.out.println("First 20 Pell numbers: "); for(n=1; n<=20; n++) { c= a + 2*b; System.out.print(c+" "); a = b; b = c; } } } ...

Sample Solution:Java Code: import java.util.Scanner; public class Example25 { public static void main(String args[]) { int n,a=1,b=0,c; System.out.println("First 20 Pell numbers: "); for(n=1; n<=20; n++) { c= a + 2*b; System.out.print(c+" "); a = b; b = c; } } } ...Flowchart:

Similar questions