Answer:
It goes like:
public class Program
{
public static void main(String[] args)
{
int j=18;
int sum=0;
for (int i =1; i<7; i++)
{
sum=sum+(i*(j-2));
j=j-2;
}
System.out.println(sum);
}
}
Explanation:
<u>Variables used: </u>
j : controls the first number in product and decreases by 2 each time the loop runs.
sum: saves the values of addition as the loop runs.
Answer:
Time Complexity of Problem - O(n)
Explanation:
When n= 1024 time taken is t. on a particular computer.
When computer is 8 times faster in same time t , n can be equal to 8192. It means on increasing processing speed input grows linearly.
When computer is 8 times slow then with same time t , n will be 128 which is (1/8)th time 1024.
It means with increase in processing speed by x factor time taken will decrease by (1/x) factor. Or input size can be increased by x times. This signifies that time taken by program grows linearly with input size n. Therefore time complexity of problem will be O(n).
If we double the speed of original machine then we can solve problems of size 2n in time t.
Answer:
What Are the Components of a Web Address?
1.Protocol. The first component of a web address is the protocol, which is also known as the scheme. ...
2.Domain Name. The domain name part of the web address is the unique identifier for the website on the internet. ...
3.Domain Extension. ...
4.Path & Filename.
Answer:
it allows them to work more efficiently, with fewer waisted resources
Explanation: