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"
The easiest way is to write the number and a factor of the number. 12 and 24 have an LCM of 24.
set totalfee = subtotal * 0.15
0.00881
1055
Yes
You write the number and then follow it with the digits in reverse order.
Pseudo code+factorial
write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)
input number for loop = 1 to 3 inclusive print number end for
You can write any algorithm in any way you like. Many prefer pseudocode or flowcharts, others use prose or more formalized methods. For example, if you wanted to describe an algorithm to count the number of occurrences of a given item I in a given list L, I would propose the following pseudocode: let counter be 0. let the current item C be the first item in list L. while C == valid { if C matches I then increment counter set C to the next item in the list } return counter.
Reference:cprogramming-bd.com/c_page2.aspx# reverse number
There are different ways of writing a pseudocode statement but the concept remains, it can be presented: /*Declare variables Total (number (3)) = 0 A (number (2)) =10 B (number (2)) =14 begin Total=A+B end
Start Input x, y ; If (x
X**y
max=number min=number counter=1 start while(counter<=3) read number start if max<number max=number else if min>number min=number end while write max write min /*modify the counter switch according to the number of values being compared if required*/
count := 27