Palindrome in c without using string function






#include<stdio.h>

int main(){
  char str[100];
  int i=0,j=-1,flag=0;

  printf("Enter a string: ");
  scanf("%s",str);

  while(str[++j]!='\0');
  j--;

  while(i<j)
      if(str[i++] != str[j--]){
           flag=1;
           break;
      }
     

  if(flag == 0)
      printf("The string is a palindrome");
  else
      printf("The string is not a palindrome");

  return 0;
}







Alogrithm:
**





10. Write a c program to add two numbers without using addition operator.
11. Write a c program to subtract two numbers without using subtraction operator.
15. Write a c program to solve quadratic equation.
18. Write a c program which passes structure to function.
28. Write a c program which takes password from user.
29. Write a scanf function in c which accept sentence from user.
30. Write a scanf function in c which accept paragraph from user.

3 comments:

  1. This Website is EXTRA ORDINARILY useful.Keep doing this great job.

    ReplyDelete
  2. really really good website i have ever seen with this much of programs.. it is very helpful to me......

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete