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
Sidana [21]
2 years ago
9

Write a function solution that, given an array A consisting of N integers, returns the number of fragements of A whose sum equal

s 0 (that is, pairs (p,q) such that P
Computers and Technology
1 answer:
zubka84 [21]2 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void fragment(int arr[], int n){

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

       for (int x = 0; x < n; x++){

           if (x != i && arr[i] + arr[x] == 0){

               cout<< arr[i] << " , " << arr[x];

           }

       }

   }

}

int main(){

   int n = 7;

   int myArr = {1, 2, -1, -2, 0, 0, 3};

   fragment(myArr, n);

}

Explanation:

The C++ source code defines an array called "myArr" in the main program and its array size n. The void function "fragment" prints out the pairs of the array whose sum equates to zero.

You might be interested in
Is Flip book drawings, frame by frame (need great drawing skills).
lyudmila [28]
I would say traditional animation
7 0
3 years ago
Int [] val = { 3, 10, 44 };
irina1246 [14]

Answer:

5) 3 0 0

Explanation:

Given data

int [] val = { 3, 10, 44 };

The total number of parameters of given array are 3, so total length of array is also 3.

The indexing of array starts with '0', Therefore the indexes of array with length zero are: {0,1,2}

The value of array at index 0 is = 3

similarly

value at index 1 = 10

value at index 2 = 44

Here, Int i = 1 is storing the value '1' in integer variable i.

In addition to that, any value of index 'i' of an array is selected using array[i].

Therefore,

val[i] = i-1 is copying the value (i-1 = 1-1 = 0) to the index '1'  of the array because i = 1.

So value at index 1 would be = val[1] = 0

The term i++ is incrementing the value of i, it makes i =2

val[i] = i-1 is copying the value (i-1 = 1-1 = 0) to the index '2' of the array because i = 2 now.

So value at index 2 would be = val[2] = 0

Hence, the output would be {3 0 0}. So 5th option is correct.

4 0
3 years ago
Business application software programs make it possible to
Daniel [21]
Business application software programs make it possible to: increase productivity in the office setting.
Please give me Brainless if this help!!
6 0
3 years ago
Is space between lines of program code that makes the code easier to read and that the compiler ignores?
MAXImum [283]
<span>The space between the lines of program codes make the code easier to read.  This is used by programmers to make their programs more readable and clear.  The space between the lines is not recognized by the compiler, thus it is ignored by the compiler.</span>
3 0
3 years ago
Clara made ice-cream by mixing 200 g of strawberry juice with 500 g of cream. What is most likely the mass of the ice-cream form
Ronch [10]

700 g, mass of ingredients are added in this chemical change

7 0
3 years ago
Other questions:
  • What is special about the f and j keys on a standard keyboard?
    15·2 answers
  • Which option describes wearable technology?
    5·2 answers
  • Which of the following scenarios is an example of irrelevant media?
    11·1 answer
  • What option do you use to view your presentation?
    15·1 answer
  • One condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a tot
    12·2 answers
  • My laptop volume has got really low all of a sudden. It wasn't the best to start with but now i can barely even hear it at 100%.
    10·1 answer
  • Mention 3 components that can be found at the back and front of the system unit​
    6·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • PLS REPLY ASAP WILL MARK BRAINLIEST
    5·2 answers
  • ¿Qué ayuda nos proporcionan las herramientas tecnológicas en estos tiempo de pandemia? ayudaaaaa plis
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!