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
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik
1.what is the vesition managment.
Difference between debugging, running, executing of an application
iam confused among testing ,.net and java. can anybody help me.
Can i please VHDL code for D-Latch with clear input ?? (HINT: Set up a “Process” with appropriate sensitivity list to get the desired D-Latch with Clr working.) Inputs and Outputs: entity Lab4b is Port ( Clr, Clk, D : in STD_LOGIC; Q : out STD_LOGIC); end Lab4b;
how to stop execution of step 3 in a job mainframe
Please describe an example where you used object orientation in one of your programs.
suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?
public static void main(String args[]) describe it
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.
kindly send interview materials
why we need to take u?
we create a pf with 3 fields.2 is defined as keyfields.we lock it with alcobj command.how we find out whether the file is locked or not?is it dspfd??/
what is the basic and unique feature of dotnet
through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?