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

How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?

2002


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

2222


1.what is the vesition managment.

2235


kindly send interview materials

1805


in cobol,wat is the difference in using 'set index in occurs clause' ....and 'occurs depending-on clause'

2290


Where do we need Operator overloading?

1173


how to work search engine? plz detail answer me.

1907


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

2226


design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

17924


how sap is different from other software ?

2229


details description on this mantis? who is founder of this mantis?

2187


define profiler???

2093


How to call dll API sub routine in VB Form.

2397


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.

2541


Have you used callsymputx? what points need to be kept in mind when using it?

2035