Social Sciences, asked by boburabdullayev707, 5 months ago

1. Calculate multiplication of array positive elements.

2. Calculate sum of array's elements, which is between minimum and maximum of array.

3. Separate sort in ascended order elements, which are in odd position and in descended order elements, which are in even positions.​

Answers

Answered by SweetestBitter
0

Answer:

1.To find the product of elements of an array.

create an empty variable. ( product)

Initialize it with 1.

In a loop traverse through each element (or get each element from user) multiply each element to product.

Print the product.

2.Simple Approach:

Sort the array in ascending order.

Sum of the first N-1 elements in the array gives the minimum possible sum.

Sum of the last N-1 elements in the array gives the maximum possible sum.

3.The program output is also shown below.

* C program to accept a set of numbers and arrange them.

* in a descending order.

int number[30];

int i, j, a, n;

printf("Enter the value of N\n");

scanf("%d", &n);

printf("Enter the numbers \n");

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

Similar questions