Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to calculate the following
i want a Java program for this condition
1+4+9+16+….+100

Like this (1^2+2^2)

Hint use function pow(a,b)

Answer Posted / sugumar

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ImprtntPrgrms;

/**
*
* @author user
*/
public class series {



public static void main(String args[]){
int i=1,sum=0;
series obj = new series();
for(i=1;i<=10;i++){
sum=sum+(i*i);

System.out.println("Values="+i*i);

}
System.out.println("Sum"+sum);

}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the merger sort principle and its time complexity.

1144


how to convert hashmap to arraylist with iteration

1961


Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.

2483


How to call dll API sub routine in VB Form.

2363


What is WEB 3.0? What are the features their in WEB3.0

2151


what is the filters in biztakk server? where it can use?

2106


5. How do you round the addition or subtraction of two numbers in assembler?

2235


1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?

2200


Code for display the images from drive using vb 6.0?

5248


Which language they use during interview?

1991


Hi I am Rathnam, How To Remove the duplicates with out using remove duplicate stage in the datastage

1944


suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

2083


For a binary tree with n nodes, How many nodes are there which has got both a parent and a child?

3667


1. Consider the following input and generate the object code using single pass assembler. JOHN START 0 USING *,15 L 1,FIVE A 1,FOUR ST 1,TEMP FOUR DC F’4’ FIVE DC F’5’ TEMP DS ‘F END

2830


write a query that returns one row for each department and the number of employees in that department. Given two tables EMPLOYEE and DEPARTMENT, where there can be multiple employees per department.

1596