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
irina [24]
3 years ago
9

Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any

two numbers can be multiplied so that the answer is greater than double the sum of all the elements in the array. If not, return the string false. For example: if arr is (2, 5, 6, -6, 16, 2, 3, 6, 5, 3] then the sum of all these elements is 42 and doubling it is 84. There are two elements in the array, 16 * 6 = 96 and 96 is greater than 84, so your program should return the string true. Examples Input: [2, 2, 2, 2, 4, 11 Output: false Input: 11, 1.2, 10, , 1, 121 Outputt true
Computers and Technology
1 answer:
vampirchik [111]3 years ago
6 0

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

  for(i = 0; i < n; i++)

  {

      sum = sum + arr[i]; //count sum

  }  

  for(i = 0; i < n; i++)

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

  for(i = 0; i < n; i++)

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

You might be interested in
Que es pilar en tecnologia
Semmy [17]
Wikipedia:The thermal copper pillar bump, also known as the "thermal bump", is a thermoelectric device made from thin-film thermoelectric material embedded in flip chip interconnects (in particular copper pillar solder bumps) for use in electronics and optoelectronic packaging, including: flip chip packaging of CPU and GPU integrated circuits (chips), laser diodes, and semiconductor optical amplifiers (SOA). Unlike conventional solder bumps that provide an electrical path and a mechanical connection to the package, thermal bumps act as solid-state heat pumps and add thermal management functionality locally on the surface of a chip or to another electrical component. The diameter of a thermal bump is 238 μm and 60 μm high.

The thermal bump uses the thermoelectric effect, which is the direct conversion of temperature differences to electric voltage and vice versa. Simply put, a thermoelectric device creates a voltage when there is a different temperature on each side, or when a voltage is applied to it, it creates a temperature difference. This effect can be used to generate electricity, to measure temperature, to cool objects, or to heat them.

For each bump, thermoelectric cooling (TEC) occurs when a current is passed through the bump. The thermal bump pulls heat from one side of the device and transfers it to the other as current is passed through the material. This is known as the Peltier effect.[1] The direction of heating and cooling is determined by the direction of current flow and the sign of the majority electrical carrier in the thermoelectric material. Thermoelectric power generation (TEG) on the other hand occurs when the thermal bump is subjected to a temperature gradient (i.e., the top is hotter than the bottom). In this instance, the device generates current, converting heat into electrical power. This is termed the Seebeck effect.[1]

The thermal bump was developed by Nextreme Thermal Solutions as a method for integrating active thermal management functionality at the chip level in the same manner that transistors, resistors and capacitors are integrated in conventional circuit designs today. Nextreme chose the copper pillar bump as an integration strategy due to its widespread acceptance by Intel, Amkor and other industry leaders as the method for connecting microprocessors and other advanced electronics devices to various surfaces during a process referred to as “flip-chip” packaging. The thermal bump can be integrated as a part of the standard flip-chip process (Figure 1) or integrated as discrete devices.

The efficiency of a thermoelectric device is measured by the heat moved (or pumped) divided by the amount of electrical power supplied to move this heat. This ratio is termed the coefficient of performance or COP and is a measured characteristic of a thermoelectric device. The COP is inversely related to the temperature difference that the device produces. As you move a cooling device further away from the heat source, parasitic losses between the cooler and the heat source necessitate additional cooling power: the further the distance between source and cooler, the more cooling is required. For this reason, the cooling of electronic devices is most efficient when it occurs closest to the source of the heat generation.

Use of the thermal bump does not displace system level cooling, which is still needed to move heat out of the system; rather it introduces a fundamentally new methodology for achieving temperature uniformity at the chip and board level. In this manner, overall thermal management of the system becomes more efficient. In addition, while conventional cooling solutions scale with the size of the system (bigger fans for bigger systems, etc.), the thermal bump can scale at the chip level by using more thermal bumps in the overall design.

4 0
3 years ago
Give five examples of top level domain​
coldgirl [10]

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

5 0
3 years ago
Read 2 more answers
does an access control list looks for patterns of traffic between multiple packets and takes action to stop detected attacks?
Kryger [21]

The access control list searches for patterns in the communication between different packets and responds to any assaults that are found.

<h3>What is the access control list?</h3>

An access control list searches for patterns in the communication between different packets and responds to any assaults that are found.

Based on the IP header data, such as the source or destination IP address, protocol, or socket number, an access control list filters traffic.

Thus, the access control list searches for patterns in the communication between different packets and responds to any assaults that are found.

Learn more about the access control list here:

brainly.com/question/13718195

#SPJ4

5 0
1 year ago
Select the correct answer from each drop-down menu.
mylen [45]

Answer:

"In a VPN, a computer connects to a server and then changes the Internet Protocol of your computer" -urgurlmarie

Source: brainly.com/question/19665457, -urgurlmarie

Opinion: You're answer is correct, I'll take this step by step but by connecting your PC to an server like OpenVPN, or a paid VPN service such as Nord VPN. You are changing your Internet Protocol of your PC to that servers I.P. Address.

7 0
2 years ago
Use the laws of propositional logic to prove the following:
frez [133]

Answer:

I attached the answer in the picture

Explanation:

Logical True and Logical False

These are kinda strange operations. Logical true always results in True and logical false always results in False no matter the premise. These operations are often referred to as “always true” and “always false”.

Binary Operators

Binary operators require two propositions. We’ll use p and q as our sample propositions.

Negation

The negation operator is commonly represented by a tilde (~) or ¬ symbol. It negates, or switches, something’s truth value.

We can show this relationship in a truth table. A truth table is a way of organizing information to list out all possible scenarios.

AND

The AND operator (symbolically: ∧) also known as logical conjunction requires both p and q to be True for the result to be True. All other cases result in False. This is logically the same as the intersection of two sets in a Venn Diagram.

Implication

Logical implication (symbolically: p → q), also known as “if-then”, results True in all cases except the case T → F. Since this can be a little tricky to remember, it can be helpful to note that this is logically equivalent to ¬p ∨ q (read: not p or q)*.

4 0
3 years ago
Other questions:
  • PLEASE HELP
    14·2 answers
  • Why is self-esteem important in self-representation
    7·1 answer
  • The data in a data warehouse have which of the following characteristics?
    12·1 answer
  • 2
    11·1 answer
  • (I made this up teehee) what anime is katski bakugo from
    15·2 answers
  • Which of the following does not make a good analysis class? (Points : 6) its name reflects its intent
    13·1 answer
  • According to the government, employees have a right to understand the risks associated with the materials they work with.
    15·1 answer
  • Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
    14·1 answer
  • There are many apps that help find you cheaper gas. If the cost of a gallon of regular gas is $3 at one station and $3.50 at ano
    15·1 answer
  • Which pair of devices have the same input motion and different outputs?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!