#include int main(void) { int i,j,k; char st; printf(\"enter string\\n\"); scanf(\"%s\", st);
scanf needs a pointer to char* to indicate you are scanning a string.
scanf
char*
You are supplying a character that's allocated on the stack.
You either want to use a getchar() or make st a char array.
getchar()
st