
write a program s=12+22+32+.........+352

class NumberExample
{
public static void main(String[] args)
{
int sum=0;
int m=0;
for(int i=12; i<=352; i+=10){
System.out.print(i+" ");
sum+=i;
}
System.out.println();
System.out.println("Sum of series: "+sum);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.