1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aniked [119]
3 years ago
11

Myvar = 0;

Computers and Technology
1 answer:
Ber [7]3 years ago
8 0

Answer:

#part (a):

Here Module(a,b) refers to modulo function.

It calculate remainder when

"a" is divided by "b".it will return 0, if a number

is completely divided by another number, otherwise

it will return the remainder.

In for loop , first iteration

myvar = myvar+Module(i,2)*i

myvar = 0+Module(1,2)*1         (i=1,myvar=0)

myvar = 0+1*1                

myvar=1

Then the value of "myvar=1" after the first iteration.

In for loop , second iteration

myvar = myvar+Module(i,2)*i

myvar = 1+Module(2,2)*2         (i=2,myvar=1)

myvar = 1+0*2                

myvar=1

Similarly it will iterate 30 times,

and at the end of for loop "myvar" will become 225.

which is equal to square of 15.

The above algorithm calculate the square of (i/2) if it odd otherwise

value of "myvar" doesn't change.

#part (b):

Here for loop runs for 30 times, so the complexity will be O(1) because

30 is a scaler number.

#part (c):

There is a function "square(n)"which gives the equivalent value of "myvar".

i.e

myvar=square(i/2).

You might be interested in
In high-tech fields, industry standards rarely change.<br> True <br> False
Sophie [7]

Answer: false

Explanation:

5 0
3 years ago
Which Internet Explorer security zone includes all Internet Web sites that are not specifically assigned to another zone?
Anna007 [38]

Answer:

Internet is the correct answer for the above question.

Explanation:

  • The Internet Explorer define some security zone (which includes the Restricted sites, internet, Trusted sites, and Local intranet) which is used to block the unwanted sites which can be opened by some other websites.
  • When any user use any website, sometimes that websites open different websites. This security zone gives the features to secure the user from this event.
  • There are four-zone which are described in the first line, in which the internet zone is used to take all the websites which are not defined for the other security zone. It means that when any user does not decide the security zone for any websites then by default it comes in the internet zone.
  • This is also asked by the question, Hence "internet" is the correct answer.
4 0
3 years ago
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach the
san4es73 [151]
She should use a condition-controlled loop. Because it uses a True/False and it will not continue until the task is done
7 0
3 years ago
Read 2 more answers
What’s the purpose of balancing or monitoring your checking account?
emmasim [6.3K]
B) To help you calculate how much money you have in your account.
3 0
3 years ago
Read 2 more answers
An administrative assistant types a document, saves, and prints. The assistant is using _____.
9966 [12]
The answer to your question is software. 
3 0
3 years ago
Other questions:
  • What part of the network is the point where the responsibility of the administrator ends and the telecommunications providers re
    5·1 answer
  • The __________ tag is used to create a forced line break without starting a new paragraph.
    13·1 answer
  • Which letter would appear in the third position of the standard wheel marking of a hard-grade wheel?
    10·2 answers
  • How can a search be narrowed to only search a particular website????
    15·1 answer
  • Choose the true statement below. (html)
    5·1 answer
  • Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
    15·2 answers
  • Select the correct answer from each drop-down menu.
    6·1 answer
  • Find the output<br>I need it immediately​
    15·1 answer
  • Which of the following statements is correct? User data cannot be combined and shared among authorized users. In a nondatabase,
    6·1 answer
  • Henry wants to create a presentation for his clients. He wants to upload the presentation file directly to the Internet. Which p
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!