Computer Science, asked by BrainlyHulk, 11 months ago

Assume an array E[ ] containing elements of structure EMPLOYEE is required to be arranged in descending order of salary. Write a c++ program to arrange the same with the help of bubble sort, array and its size is required to be passed as parameter to function .

Class 12 CBSE Computer science, C++​

Answers

Answered by Anonymous
0

Input : arr[] = {-1, 0, 1, 2, 3, 4}  

      A = -1, B = 2, C = -1

Output : {-9, -4, -4, -1, -1, 0}

Input array is {-1, 0, 1, 2, 3, 4}. After

applying the equation A*x*x + B*x + C on

every element x we get, {-4,-1, 0, -1, -4, -9}

After sorting, we get {-9, -4, -4, -1, -1, 0}

Answered by Anonymous
0

float diasum(float A[ ][ ],int R,int C)

{ int i,j;

float Dsum=0.0;

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

for(j=0;j<C;j++)

if((i= = j)| | (i+j)= =(size-1))

Dsum=Dsum+A[i][j];

return Dsum;

}

Similar questions