




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





char *ch_ptr; 2 char ch = โjโ; 3 ch_ptr = &ch; // assume address of ch = 7504 4 printf (โ%cโ, ch); 5 printf (โ%cโ, *ch_ptr); 6 printf (โ%dโ, ch_ptr); 7 printf (โ%dโ, &ch); 8 printf (โ%dโ, &ch_ptr);
void func1(float, int (*)(int, float)); int func2 (int, float); int func3 (int, float);
float num = 3.0f; func1(num, func2); func1(num, func3);
Write a program that uses bubble sort to sort an array ofvalues. The array to sort can be hard-coded, but whetherto sort the list in ascending or descending order will bedecided by prompting the user. Instead of having twodifferent bubble sort functions, have one bubble sortfunction that takes another function as a parameter. Thatfunction will be used to compare for sorting in ascendingor descending order. Output the sorted array. Here is thebubble_sort function prototype (array, size, comparefunction): void bubble_sort(int , int, int ()(int, int));