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 / mahavishnu
class Demo{
void check()
{
int a=0;
for(int i=1;i<=10;i++)
{
int b=i*i;
a=a+b;
System.out.println(a);
}
}
}
public class Newdemo
{
public static void main(String[] args)
{
Demo d=new Demo();
d.check();
}
}
Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
what is radio button? Plz show code this! how will select radio buttons to go next window Forms? Supose o radio button1 o radio button2 o radio button3 o radio button4 how will coding this? Plz explain this!
hi viewers, tell me,what is scripting and programming, define and difference...pls
how we can know the funcions available in a class recording java?
what does mean and stack mean in genral programming?
what is web service in java? have u use before.
Hi Guys, This is Rama, right now I am working as a Software Test Engineer in Gurgoan and I have over all 3 years of testing expoeriance. Right now I am looking for a change. Can any body help me out to find a job in south india. Thanks in Advance
4. What is the need of START 0? Instead if can we use any other numeric? If we use what will happen?
what is dot net framework
Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.
What is Negative testing?
Why did you ever become involved in QA/testing?
kindly send interview materials
Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.
how do u handle table control inbdc explain the process in steps iwant the answer in urgent please forward this even i know how to explain there
what do u mean by tagging