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
Which of the following is not a characteristic of Web 2.0?
Dmitry [639]

Answer:

c. mentorship programs taking place via the internet

Explanation:

The World Wide Web (WWW) was created by Tim Berners-Lee in 1990, which eventually gave rise to the development of Web 2.0 in 1999.

Web 2.0 can be defined as a collection of internet software programs or applications which avails the end users the ability or opportunity to share files and resources, as well as enhance collaboration over the internet.

Basically, it's an evolution from a static worldwide web to a dynamic web that enhanced social media. Some of the examples of social media platforms (web 2.0) are You-Tube, Flickr, Go-ogle maps, Go-ogle docs, Face-book, Twit-ter, Insta-gram etc.

Some of the main characteristics of Web 2.0 are;

I. Social networking.

II. Blogging.

III. Interactive comments being available on many websites.

Also, most software applications developed for Web 2.0 avails its users the ability to synchronize with handheld or mobile devices such as smartphones.

However, mentorship programs taking place via the internet is not a characteristic of Web 2.0 but that of Web 3.0 (e-mentoring).

7 0
3 years ago
Please I have been having a problem with this assignment of mine but I have not gotten an answer. Idiot know if anybody could be
ICE Princess25 [194]

Answer:

ummm

Explanation:

your on your own it doesn't makes since

3 0
3 years ago
QUESTION 4
Kaylis [27]

Answer: 2, 3, 6, 8

Explanation:

i must tell you something very important.

in LISTS.... the FIRST thing is marked with a 0.

[0, 1, 1, 2, 3, 6, 8, 13, 21, 34]

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

do you see how these line up with each other?

the output would be 2, 3, 6, 8

4 0
3 years ago
What do these symbols mean in technology
marta [7]

Answer:

1.us dollar which not not allow

2. pause botton

5 0
3 years ago
Quinn recently launched a Display campaign for his women's clothing store. Since the launch, his website traffic has increased,
photoshop1234 [79]

<u>Full question:</u>

Quinn recently launched a Display campaign for his women’s clothing store. Since the launch, his website traffic has increased, but sales have remained flat. Which story shows Quinn using remarketing to drive action?

A. Quinn remarkets using his original business objectives and campaigns, with new users from an uploaded compatible list. By leveraging existing materials, he aims to extend his reach while saving cost.

B. Quinn creates a list of cart abandoners that identifies users who visited his website, considered buying his clothing, but didn’t purchase. He shows them an ad with a promotional discount code.

C. Quinn uses the In-Market audience segment for baking supplies with the intent of reaching potential customers while they’re actively browsing for women’s apparel and are close to a conversion.

D. Quinn creates a custom audience segment using keywords and URLs as inputs. He hopes to extend his audience to customers interested in women’s accessories.

Option B

Quinn creates a list of cart abandoners that identifies users who visited his website, considered buying his clothing, but didn’t purchase. He shows them an ad with a promotional discount code shows Quinn using remarketing to drive action

<h3><u>Explanation:</u></h3>

Remarketing is a manner of online advertising that allows sites to exhibit targeted ads to users who have previously hit their site. Remarketing consists of practicing special tracking code to order cookies on the browsers of somebody hitting your website and then assisting ads to those with that cookie.

Because Quinn is dispensing promotional discount code ads to the personality who hit his website, consider purchasing his clothing, but didn’t acquire. Remarketing lets you target those people who have toured your website or entered your app.

4 0
4 years ago
Other questions:
  • Question 1
    9·1 answer
  • What does the Sort feature do with a database
    13·1 answer
  • Ok so sometimes when i do something i see a box with a question mark in it, how do i remove it, i am on a macOs High Sierra earl
    11·1 answer
  • Distinguish between exponentiation and modulus. Be specific.
    5·1 answer
  • What is computer system<br>explain the role of bank in computer<br>​
    15·2 answers
  • Why do digital media professionals create portfolios of their work?
    5·1 answer
  • A __________ is a sequence of characters.
    10·1 answer
  • Briefly the conceptual model of effective computer based instruction for adults outlining three units (output, Process and input
    9·1 answer
  • A web application's code prevents the output of any type of information when an error occurs during a request. The development t
    12·1 answer
  • Write the working principle of a computer and explain it. ​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!