Write a Java program that prints the following series: 0, 4, 18, 48, 100.........n terms
Answers
Answered by
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:(
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
1
answer is the format of zero
Similar questions