### Ask Your question

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

### Search & Filtering

how to change the code so that it can sort

struct SResult sample[] = { {"A1234", 10}, {"A1239", 5}, {"A1394", 7}, {"A1434", 3}, {"A1454", 5}, {"A2884", 7}, {"A3235", 7}, {"A4334", 9}, {"A4884", 2}, {"A6934", 5}, {"A7265", 7}, {"A9559", 3} };

void counting_sort(struct SResult scoreArr[], int N, int final[]) {

int freq[11] = {0}, cfreq[11] = {0};

int i, curScore;

//1. Compute Frquency

for (i = 0; i < N; i++){

freq[ scoreArr[i].score ] ++;

}

//2. Compute Cumulative Frequency

cfreq[0] = freq[0];

for (i = 1; i < 11; i++){

cfreq[i] = cfreq[i-1] + freq[i];

}

//3. Produce Final Position

for (i = 0; i < N; i++){

curScore = scoreArr[i].score;

final[ cfreq[ curScore ] - 1 ] = curScore;

cfreq[curScore]--;

}

}

struct SResult sample[] = { {"A1234", 10}, {"A1239", 5}, {"A1394", 7}, {"A1434", 3}, {"A1454", 5}, {"A2884", 7}, {"A3235", 7}, {"A4334", 9}, {"A4884", 2}, {"A6934", 5}, {"A7265", 7}, {"A9559", 3} };

void counting_sort(struct SResult scoreArr[], int N, int final[]) {

int freq[11] = {0}, cfreq[11] = {0};

int i, curScore;

//1. Compute Frquency

for (i = 0; i < N; i++){

freq[ scoreArr[i].score ] ++;

}

//2. Compute Cumulative Frequency

cfreq[0] = freq[0];

for (i = 1; i < 11; i++){

cfreq[i] = cfreq[i-1] + freq[i];

}

//3. Produce Final Position

for (i = 0; i < N; i++){

curScore = scoreArr[i].score;

final[ cfreq[ curScore ] - 1 ] = curScore;

cfreq[curScore]--;

}

}

A point represents a coordinate in an x-y plane. It is supported by the following functions:

Point * make_point(double x, double y)

double x_of(Point *p)

double y_of(Point *p)

void print_point(Point *p)

Write a function Point * mid_point that accepts two points as arguments and returns a point that is the mid-point of these two input coordinates.

Point * make_point(double x, double y)

double x_of(Point *p)

double y_of(Point *p)

void print_point(Point *p)

Write a function Point * mid_point that accepts two points as arguments and returns a point that is the mid-point of these two input coordinates.

Improve the algorithm so can sort below array:

void counting_sort(struct SResult scoreArr[], int N, int final[])

{

int freq[11] = {0}, cfreq[11] = {0};

int i, curScore;

//1. Compute Frquency

for (i = 0; i < N; i++){

freq[ scoreArr[i].score ] ++;

}

//2. Compute Cumulative Frequency

cfreq[0] = freq[0];

for (i = 1; i < 11; i++){

cfreq[i] = cfreq[i-1] + freq[i];

}

//3. Produce Final Position

for (i = 0; i < N; i++){

curScore = scoreArr[i].score;

final[ cfreq[ curScore ] - 1 ] = curScore;

cfreq[curScore]--;

}

}

struct SResult sample[] = {

{"A1234", 10},

{"A1239", 5},

{"A1394", 7},

{"A1434", 3},

{"A1454", 5},

{"A2884", 7},

{"A3235", 7},

{"A4334", 9},

{"A4884", 2},

{"A6934", 5},

{"A7265", 7},

{"A9559", 3}

};

void counting_sort(struct SResult scoreArr[], int N, int final[])

{

int freq[11] = {0}, cfreq[11] = {0};

int i, curScore;

//1. Compute Frquency

for (i = 0; i < N; i++){

freq[ scoreArr[i].score ] ++;

}

//2. Compute Cumulative Frequency

cfreq[0] = freq[0];

for (i = 1; i < 11; i++){

cfreq[i] = cfreq[i-1] + freq[i];

}

//3. Produce Final Position

for (i = 0; i < N; i++){

curScore = scoreArr[i].score;

final[ cfreq[ curScore ] - 1 ] = curScore;

cfreq[curScore]--;

}

}

struct SResult sample[] = {

{"A1234", 10},

{"A1239", 5},

{"A1394", 7},

{"A1434", 3},

{"A1454", 5},

{"A2884", 7},

{"A3235", 7},

{"A4334", 9},

{"A4884", 2},

{"A6934", 5},

{"A7265", 7},

{"A9559", 3}

};

#include<stdio.h>

int main()

{

int n;

for(n = 7; n!=0; n--)

printf("n = %d", n--);

getchar();

return 0;

}

anyone tell the o/p ??

int main()

{

int n;

for(n = 7; n!=0; n--)

printf("n = %d", n--);

getchar();

return 0;

}

anyone tell the o/p ??

11: Write code that tells a user that the letter they entered is not a b or a c.

14: Write a code to print all multiples of 5 between 1 and 100 (including both 1 and 100).

15: Write a code that will count all the even numbers up to a user defined stopping point.

16. Input 3 numbers and print either an "all 3 equal" or a "not all equal" message.

18.Input 3 numbers, and print the biggest

14: Write a code to print all multiples of 5 between 1 and 100 (including both 1 and 100).

15: Write a code that will count all the even numbers up to a user defined stopping point.

16. Input 3 numbers and print either an "all 3 equal" or a "not all equal" message.

18.Input 3 numbers, and print the biggest

13: Write a code that performs the following: Ask a user to enter the exam score. If the score is between 0 and 69, write “ You failed the exam.” If the score is between 70 to 85, write “ Your grade is satisfacory.”, if the score is between 86 to 96, write “ Your grade is very satisfactory.”, if the score is 97 to 100 , write “ Your grade is excellent.”.

6. Create a flowchart to add two numbers together and display the result.

7. Write a program that determines the total resistance of a three resistor

parallel circuit.

R1 =

R2 =

R3 =

RT =

8. Write a program that converts ohms to kiloohms and vice versa.

Please enter the resistance :

You entered 10 Kiloohms.

10 Kiloohms is equal to 10000 ohms

9. Write a program that converts ampere to milliampere and ampere to microampere. Follow the display of number 8.

10.: Write a code that reads two numbers and multiplies them together and print out their product. Display the entered numbers and their product.

10 X 3 = 30

7. Write a program that determines the total resistance of a three resistor

parallel circuit.

R1 =

R2 =

R3 =

RT =

8. Write a program that converts ohms to kiloohms and vice versa.

Please enter the resistance :

You entered 10 Kiloohms.

10 Kiloohms is equal to 10000 ohms

9. Write a program that converts ampere to milliampere and ampere to microampere. Follow the display of number 8.

10.: Write a code that reads two numbers and multiplies them together and print out their product. Display the entered numbers and their product.

10 X 3 = 30

15: Write a code that will count all the even numbers up to a user defined stopping point.

16. Input 3 numbers and print either an "all 3 equal" or a "not all equal" message.

18.Input 3 numbers, and print the biggest

19. Input 10 numbers, and print their total.

20. Read in three numbers, call them A, B and C.

• If A is bigger than B, then if A is bigger than C, print out A, otherwise print out C.

• If B is bigger than A, then if B is bigger than C, print out B, otherwise print out C.

16. Input 3 numbers and print either an "all 3 equal" or a "not all equal" message.

18.Input 3 numbers, and print the biggest

19. Input 10 numbers, and print their total.

20. Read in three numbers, call them A, B and C.

• If A is bigger than B, then if A is bigger than C, print out A, otherwise print out C.

• If B is bigger than A, then if B is bigger than C, print out B, otherwise print out C.

c program for vowel or not

int i=-1,j=10,k,l;

k=i && j;

l=i || j;

printf("%d %d",l,j);

k=i && j;

l=i || j;

printf("%d %d",l,j);