The following code demonstrates A Simple Example of Using Function Pointer in C.

// Bubble Sort using pointers

#include <stdio.h>
int f1(int a, int b)
{
    return a+b;
}
int f2(int a, int b)
{
    return a-b;
}
int f3(int a, int b)
{
    return a*b;
}
int main()
{
    int (*fp[])(int, int)={f1, f2, f3};
    int i, j, total, size, t, finished=1;
    
    for(i=0;i<3;i++)
    {
        printf("%d ", (*fp[i])(12, 5));
    }
    return 0;
}

Output

17 7 60


Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number