• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
To check whether the entered string is palindromeor not 
#include <stdio.h>#include <conio.h>#include <string.h>void main(){clrscr();char str1[20],str2[20];int m,x,i,j; printf("\n Enter any string - ");scanf("%s",&str1);m=strlen(str1);for(i=m-1,j=0;i>=0;i--,j++){str2[j]=str1[i];}str2[j]='\0';x=strcmp(str1,str2);if(x!=0) printf("\n The entered string is not palindrome");if(x==0) printf("\n The entered string is palindrome");getch();}
1
 
To concatenate two strings
#include<stdio.h>#include<conio.h>#include<string.h>void main(){clrscr();char a[20],b[20]; printf("Enter the first string = ");scanf("%s",&a); printf("Enter the second string = ");scanf("%s",&b);strcat(a,b); printf("The concatenated string is = "); printf("%s",a);getch();}
2
 
To find the reverse of a string 
#include<stdio.h>#include<conio.h>#include<string.h>void main(){clrscr();char a[20]; printf("Enter the first string = ");scanf("%s",&a);strrev(a); printf("The reverse string is = "); printf("%s",a);getch();}
3
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...