answersLogoWhite

0


Best Answer

echo "enter the number"

if [ $# -ne 1 ]

then

echo "Usage: $0 number"

echo " I will find reverse of given number"

echo " For eg. $0 12321, I will print 12321"

exit 1

fi

n=$1

rev=0

sd=0

while [ $n -gt 0 ]

do

sd=`expr $n % 10`

rev=`expr $rev \* 10 + $sd`

n=`expr $n / 10`

done

echo "Reverse number is $rev"

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: To write shell program to check the given number and its reverse are same?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Fox pro program to reverse the given number?

reverse programe in fox pro


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


Lab manual in mca 1st sem from ignou?

write a program in C to check whether a given number is apalindrome or not


C program to check whether the number and its reverse are same or not?

#include <stdio.h> #include<conio.h> void main () { int a,r,n,sum=0; clrscr(); printf("enter the number"); scanf("%d",& n); c=n while (n!=0) { a=n%10; n=n/10; sum=sum*a+a } printf("the reverse is %d \n",sum); if(c==sum) printf("\n the given number is palindrome"); else printf("\n the given number is not a palindrome"); getch(); }


Enter a number and draw a flow chart to get the reverse of the given number and the number is 435?

123


How can you generate a palindrome from a given number?

You write the number and then follow it with the digits in reverse order.


What can the reverse lookup be used to find?

The reverse lookup is a telephone number data base. Instead of looking up a phone number based on a given name, a name can be looked up based on a given phone number. It is useful when receiving phone calls from an unknown phone number.


To check whether the given number is an Avogadro number or not?

45


Program to find reverse of given number using pointers?

#include #include void main() { int rev num=0; while(num>0) { rev num=rev num*10+num%10; num=num%10; } return rev_num; } int main(); { int num=4562; printf("reverse of number is%d",reverse digit(num)); getch(); return o; }


Do an 8086 assembler program to find parity of a given number?

sdfsdfsfsggbcvbg


Program to check whether the entered number is even or odd?

#include<stdio.h> #include<conio.h> void main() { int n; printf("ENTER NO FOR CHECK........ "); scanf("%d", &n); if(n%2==0) printf("Given No is EVEN"); else printf("Given No is ODD"); getch(); }