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
What would best describe the future of cybersecurity?
Andrei [34K]

The best describe the future of cybersecurity is strong security policies offer little protection.

<h3>What is cybersecurity?</h3>

Cybersecurity is the security of data or computer systems. Cybersecurity is provided from the hackers that hacks the data and money online.

As everything is converting digital, the need of cybersecurity is increasing.

Thus, the correct option is B.

Learn more about cybersecurity

brainly.com/question/27560386

#SPJ1

5 0
2 years ago
_____ is a program that is specifically used to look at various World Wide Web resources.
Darina [25.2K]

Answer:

B: The World Wide Web

Explanation:

6 0
3 years ago
What is the general term for programs that act without a user’s knowledge and deliberately alter the computer’s operations?
noname [10]

Answer:

Malware, short for malicious software, consists of programs that act without a user's knowledge and deliberately alter the operations of computers and mobile devices

Explanation:

7 0
3 years ago
To clarify a word while reading, a
Crazy boy [7]

Answer:

look up the word in the dictionary and break it down

Explanation:

4 0
3 years ago
How many microprocessors will a small computer have
Arte-miy333 [17]
Well, most of the new Pc's today have dual-core central processors (CPU). They only have one chip with two complete microprocessors on it, both of them share one path to memory and peripherals. But if it's a high-end hardcore gaming Pc, you could have two processor chips with 4 microprocessors on each.
4 0
4 years ago
Read 2 more answers
Other questions:
  • What is one way in which tablets differ from laptops and notebooks
    12·2 answers
  • What does ascii stand for?
    14·2 answers
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • Tara needs to select all of the text in a Word document. Which keyboard shortcut will achieve this goal?
    9·2 answers
  • Ahem, so basically I added a extension on my SCHOOL chromebook, and I want to get rid of it because it keeps opening extra tabs
    5·1 answer
  • write a function named list_total that accepts a list as an argument (assume the list contains integers) and returns the cumulat
    11·1 answer
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • It is common for people to name directories as dir1, dir2, and so on. When there are ten or more directories, the operating syst
    8·1 answer
  • Which of the following options is not located in the page setup dialog box?
    14·1 answer
  • Every time attribute A appears, it is matched with the same value of attribute B, but not the same value of attribute C. Therefo
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!