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
What is the merger sort principle and its time complexity.
how to convert hashmap to arraylist with iteration
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.
How to call dll API sub routine in VB Form.
What is WEB 3.0? What are the features their in WEB3.0
what is the filters in biztakk server? where it can use?
5. How do you round the addition or subtraction of two numbers in assembler?
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?
Code for display the images from drive using vb 6.0?
Which language they use during interview?
Hi I am Rathnam, How To Remove the duplicates with out using remove duplicate stage in the datastage
suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?
For a binary tree with n nodes, How many nodes are there which has got both a parent and a child?
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
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.