#include #include #include #include char* ques[] = {"Hi","How are you?","What is your name?", "What is the capital of Bangladesh?"}; char* ans[] = {"Hello!","I am fine","It's sss and you?","The capital of Bangladesh is Dhaka"}; void talk_func(void); char human_talks[150]; char cont; int main() { printf("Assalamu alaikum\n"); printf("I am a CHATBOT\n"); printf("I can converse with you...\n"); talk_func(); return 0; } void talk_func(void) { do { printf("Enter"); scanf("%[^\n]", &human_talks); int i =0; for (i = 0;;i++){ if (strcmp(ques[i],human_talks)==0) { printf("%s\n", ans[i]); } printf("Wanna ask something again?\n"); cont = getch(); } } while ( cont == 'y'); getch(); return 0; }