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 / sumitpalsingh

public class Power {

public static void main(String[] args) {
int b=2;
for(int i=1;i<=10;i++)
{
System.out.println(Math.pow(i,b));
}


}

}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many types of operating system are avaliable?

2277


In project we have Documentation phase also,in that what is micro and macro designing?

1806


In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..

1414


When will you use shell script/Perl ahead of C/C++?

1041


how CLR identify vb file?

2975


hi viewers, tell me,what is scripting and programming, define and difference...pls

1924


how can we maintain the previous version scripts to new version.

1881


what are the 3 forms of a prolog term

3188


What is the use of Differ interface check box in Ship confirm?

2314


8.In DSP,Define Signal and System?and various type of signals.

1976


how to data grid use in data bind?

1953


what is difference between kpo and it industry? that is in terms of work, package etc

1927


1. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?

2327


I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...

2994


what are all the validation we need to perform in data stage?

2353