Computer Science, asked by BrainlyPromoter, 1 year ago

Write a Java program that prints the following series: 0, 4, 18, 48, 100.........n terms

Answers

Answered by shardul1925
3
public class Pattern {

void main(int n) { //to take the term

int i ;

for(i=1;i<=n;i++) {

int s=0;

s=(int)Math.pow(i,3)- (int)Math.pow(i,2) ;

System.out.print( s + ",");

}

}

}

The other method is in the attachment ☝️☝️☝️☝️.(Actually it is not the method but the longer form of this easy utility.)

Hope it helps:(
Attachments:

shardul1925: let me check this bro..
Answered by killerjoker11
1

answer is the format of zero

Similar questions