+ 1
i am not getting the name. why? everytime it is showing 'i don't know'....
#include<stdio.h> void main() { char q[30]; printf("enter question="); scanf("%[^\n]",&q); switch(q[30]) { case 'what is your name?': printf("ans=lamia"); break; default: printf("I don't know"); break; } getch(); }
7 Answers
+ 6
Sorry I had to do something for my son.
https://code.sololearn.com/c6tP7EAQ3ib3
+ 5
Do you plan on having multiple questions that must be typed in exactly or would you rather have a unique keyword (e.g. name, age, gender)?
+ 4
You can't match a case of 'what is your name?' and you are testing the first character beyond the end of your array.
+ 2
thanks a lot...u helped me a lot.....âșâșâș
+ 1
can u please tell me the right way?
+ 1
yeah
+ 1
multiple questions