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.

5 comments:

Balasubramanian said...

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

nithya thiyagarajan said...

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

Sora chan said...
This comment has been removed by the author.
Hassan Raza said...

Its good helping us

Hassan Raza said...

Its good helping us