Q.एक ऐसा शैल program लिखिए जो कि एक string को reverse order मे print करे।Ans.read -p “Enter string:” string
len=${#string}
for (( i=$len-1; i>=0; i– ))
do
# “${string:$i:1}”extract single single character from string.
reverse=”$reverse${string:$i:1}”
done
echo “$reverse”
EasyExamNotes.com
Program to print string in reverse order
Source: https://easyexamnotes.com/program-to-print-string-in-reverse-order/
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion