Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


k.jahangir kumar
javaprograms
1 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners


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


Advertisement
View Answers

September 9, 2011 at 4:16 PM


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);
    }
}


Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com