#include <stdio.h> char arraysearch(int data) { //some code return (data+2); } char linkedlistsearch(int data) { //some code return (data-2); } char binarysearch(int data) { //some code return (data * 2); } char search( char (*funcptr)( int ), int data ) { return (*funcptr)(data); } int main(int argc, char* argv[]) { printf("Input Options "); printf("1 arrsrch "); printf("2 linkedlistsrch "); printf("3 binarysrch "); printf("4 exit "); int choice = 0; int data; int ret = 0; while(choice != 4) { printf("Input choice: "); scanf("%d", &choice); if(choice == 4) { printf("goodbye! "); break; } printf("Data to search "); scanf("%d", &data); if(choice == 1) { ret = search(arraysearch,data); //invoking 1st function } else if(choice == 2) { ret = search(linkedlistsearch, data); //invoking 2nd function } else if(choice == 3) { ret = search(binarysearch, data); //invoking 3rd function } printf("ret = %d ", ret); } return 0; }