Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
QuestResp
//gcc 7.4.0 //QuestResponse: example of array of pointers and function pointer //this code is created by Rezaul Hoque on March 29,2022; //contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <stdio.h> #include <stdlib.h> #include <string.h> int question (); void response(int (*)()); int question (){ char q[30]; scanf("%s",q); int index,s; s=strlen(q); index=s%3; return index;} void response (int (*fp)()) { fp=question; int index; index=(*fp)(); char* r[3]={"Yes","No","Sometimes"}; printf(r[index]); } int main(){ question(); response(question); return 0; }
run
|
edit
|
history
|
help
0
MatrixMul_shortxshort
Simple Calculator v1.0
to upper case string
extra causes class UK assisment
Assignment 3
BSEARCH() COMPLETE
Project 3 Part 1 v1.6
Fgets and String Stuff
FUNCION strstr()
A_141212_IntercambiarValores