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
nadya68 [22]
2 years ago
12

Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al

l the numbers in the array multiplied
Computers and Technology
1 answer:
JulijaS [17]2 years ago
4 0

left[0]=a[0];

for(int i=1;i<=n-1;i++)

   left[i]=(left[i-1]*a[i])%M;

right[n-1]=a[n-1];

for(int i=n-2;i>=0;i--)

   right[i]=(right[i-1]*a[i])%M;

for query q

   if(q==0)

       return right[1]%M;

   if(q==n-1)

       return left[n-2]%M;

   return (left[q-1]*right[q+1])%M;

You might be interested in
What is one disadvantage people face without a checking account?
sveticcg [70]

Answer:

If they have a job that only pays with ckecks they won't be able to have their paycheck.

Explanation:

8 0
2 years ago
What is a variable?
aleksandr82 [10.1K]
Answer. D: a value that looks loads when the program runs.


Explanation:

In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running.
5 0
3 years ago
Research and identify at least five specialized search engines and their applications.
Varvara68 [4.7K]

Specialized search engines indexes content specialized by topic or location and are used to deliver more relevant results to the user. It indexes pages for particular topics. Examples of specialized search engines and their applications include;

1. Uquery.com – This new search engine focuses more on the emergence of iPhone and iPod touch applications

2. Taptu.com – A downloadable search engine that helps the user find items specific to fit on a mobile screen

3. Yahooligans – A sub-domain of yahoo that focuses on kid friendly games.

4. Pubmed.com – This is specifically meant for students in medical schools

5. Zillow.com – Online real estate service that provides information regarding home purchase.

5 0
3 years ago
Flesh out the body of the print_seconds function so that it prints the total amount of seconds given the hours, minutes, and sec
fiasKO [112]

Answer:

Step by step explanation along with code and output is provided below

Explanation:

#include<iostream>

using namespace std;

// print_seconds function that takes three input arguments hours, mints, and seconds. There are 60*60=3600 seconds in one hour and 60 seconds in a minute. Total seconds will be addition of these three  

void print_seconds(int hours, int mints, int seconds)

{

   int total_seconds= hours*3600 + mints*60 + seconds;

   cout<<"Total seconds are: "<<total_seconds<<endl;

}

// test code

// user inputs hours, minutes and seconds and can also leave any of them by  entering 0 that will not effect the program. Then function print_seconds is called to calculate and print the total seconds.

int main()

{

   int h,m,s;

   cout<<"enter hours if any or enter 0"<<endl;

   cin>>h;

   cout<<"enter mints if any or enter 0"<<endl;

   cin>>m;

   cout<<"enter seconds if any or enter 0"<<endl;

   cin>>s;

   print_seconds(h,m,s);

  return 0;

}

Output:

enter hours if any or enter 0

2

enter mints if any or enter 0

25

enter seconds if any or enter 0

10

Total seconds are: 8710

8 0
3 years ago
What does a computer use long-term memory, or ROM, for?
AysviL [449]
The answer is B

Explanation: In contrast, a computer's hard disk or SDD is its long-term memory, where things are stored more or less permanently. ... Nearly all computers also have some way to store information for longer-term access, too.

5 0
2 years ago
Other questions:
  • Write a complete program to do the following: The main program calls a method to read in (from an input file) a set of people's
    12·1 answer
  • How can you best utilize CSS for Web Development?
    6·1 answer
  • Match the following.
    8·2 answers
  • CAD helps professionals to _____. create a technical drawing give directions to a new location calculate the interest rate of a
    13·2 answers
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Design a full adder circuit using NAND gates only (input : A, B, Cin and output = S, Cout).
    5·1 answer
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • second question today 25 POINTS: What is the formula to balance a lever when both effort and resistance are present?
    14·1 answer
  • Mention any
    14·1 answer
  • A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 9
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!