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
How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?
What is WEB 3.0? What are the features their in WEB3.0
1.what is the vesition managment.
kindly send interview materials
in cobol,wat is the difference in using 'set index in occurs clause' ....and 'occurs depending-on clause'
Where do we need Operator overloading?
how to work search engine? plz detail answer me.
I need to fetch all rows from the table based one field value in the table and later do a condition check if the condition is true I will have to move all the rows present in the data base to output file one else if the condition is not satisfied then move all the records of that field value into another file .Please let me know how to do that
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
how sap is different from other software ?
details description on this mantis? who is founder of this mantis?
define profiler???
How to call dll API sub routine in VB Form.
Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.
Have you used callsymputx? what points need to be kept in mind when using it?