Write a script to display the digits which are in an odd position in a given 6 digit number in Linux
Write a script to display the digits which are in an odd position
in a given 6 digit number in Linux
Program =
#!/bin/bash
echo
"Utsav gohel 91900104011"
echo
Enter a 6 digit number
read
num
n=1
while
[ $n -le 6 ]
do
a=`echo
$num | cut -c $n`
echo
$a
n=`
expr $n + 2 `
done
Output =