C LANGUAGE TUTORIAL-(2)-PALINDROME STRING - TECH-TUTORIALS

TECH-TUTORIALS

Post Top Ad

Responsive Ads Here

C LANGUAGE TUTORIAL-(2)-PALINDROME STRING

Share This

PALINDROME STRING



"Palindrome" is a greek word;the world "palin" means  back and "drome" means direction.a string is said to be palindrome if by moving forward and reverse traversal we get the same result.lets take an example:-if we consider "malayalam" string as a input,so by moving start to end(forward traversal)and end to start(reverse traversal)we will get the same result,so we can say this is palindrome,on the other hand if we take the word"electronics",then it is non-palindrome because if we  take the backward traversal we are getting "scinortcele"(reverse of the word electronics).

Example:-"madam","malayalam","civic".


Flowchart:-































                    Program code using c:-


























CODE:-



#include<stdio.h>

#include<conio.h>

#include<string.h>

int main()
{
char str[25];
int l,i;
printf("enter the string that need to be chcek:-  ");
gets(str);
l=strlen(str);
for(i=0;i<l/2;i++)
{
if(str[i]!=str[l-1-i])
{
printf("oops!!!!this is not palimdrome");
break;
}
}
if(i==l/2)
{
printf("palindrome");
}
}


OUTPUT SCREEN:-

case-1
case-2










































"for more tutorial'




6 comments:

  1. At some point couple of instructive online journals turn out to be extremely useful while getting applicable and new data identified with your focused on region. As I discovered this blog and value the data conveyed to my database. small text generator

    ReplyDelete
  2. Fantastic post, very informative. I wonder why the other specialists of this sector do not notice this. You must continue your writing. I'm confident, you have a great readers' base already! tik tok porn

    ReplyDelete
  3. play bazaar satta king
    play bazaar satta king If you really want to fulfill the smoothie experience, add a little non-fat, unsweetened yogurt to your drink.

    ReplyDelete
  4. Thank you for the inspiration I've discovered here. To have a deeper understanding, read this article Mouse DPI. The mouse DPI controls the speed at which the cursor goes across the screen.

    ReplyDelete

Post Bottom Ad

Responsive Ads Here

Pages