clear echo " STRING PALINDROME OF NOT" echo " ========================" echo "ENTER STRING : " read str len=`echo $str | wc -c` i=1 while [ $i -le $len ] do ch=`echo $str | cut -c $i` revstr="$ch$revstr" i=`expr $i + 1` done if [ "$str" == "$revstr" ];then echo "String is palindrome" else echo "String is not palindrome" fiOutput:
0 comments:
Post a Comment