Code palindrome in c using queue and stuck?

  1. /*
  2. * C Program to Check String is Palindrome using Stack.
  3. */
  4. #include <stdio.h>
  5. #include <string.h>
  6. void push(char);
  7. char pop();
  8. char stack[100];
  9. int top = -1;
  10. void main()
  11. {
  12. char str[100];
  13. int i, count = 0, len;
  14. printf("Enter string to check it is palindrome or not : ");
  15. scanf("%s", str);
  16. len = strlen(str);
  17. for (i = 0; i < len; i++)
  18. {
  19. push(str[i]);
  20. }
  21. for (i = 0; i < len; i++)
  22. {
  23. if (str[i] == pop())
  24. count++;
  25. }
  26. if (count == len)
  27. printf("%s is a Palindrome string\n", str);
  28. else
  29. printf("%s is not a palindrome string\n", str);
  30. }
  31. /* Function to push character into stack */
  32. void push(char c)
  33. {
  34. stack[++top] = c;
  35. }
  36. /* Function to pop the top character from stack */
  37. char pop()
  38. {
  39. return(stack[top--]);
  40. }