Explanation:
Let solve the program using Java programming language
Method: method means group of statements to perform some operation.
let call the method sum.
Parameters: list of variables that are use in the method for declaration.
<u>The code</u>
public int sum (int number)
int answer;
if (number == 1)
answer = number;
else
{
int half = number/2;
int span = number - half;
answer = sum(half) + sum(span) + (half * span);
}
answer result;
}
Firstly we defined the method called sum(), the method takes only one parameter which is number and return the answer(sum of the integers 1 and N).
if the number is equal to 1, so it will return the number and if the number is not equal to 1 it will divide the number by 2 and get the span(span used to shift upper range).And result will add sum of half, sum of span and product of half span.
Try to split the questions for easy access
Answer:
large
Explanation:
the harder you pluck the louder it gets
The acceleration of the body in terms of the gravitational constant G is G.
According to Newton's law of universal gravitation;
F = Gm1m2/r^2
G = gravitational constant
m1 = mass of the first body
m2 = mass of the second body
r = distance between the two bodies
Substituting values to find the force on the two bodies;
F = G × 1 × 2/1^2
F = 2G
For the 2 Kg mass
F = ma
m = mass
a = acceleration
F = gravitational force
Hence,
2G = 2a
a = 2G/2
a = G
Learn more: brainly.com/question/13860566