ex13.
ex13.
.we do the first operation( to find the LSB) which is l=N mod 10
. To deal with the other digits we repeat the following operation while N is
greater or equals 10
Otherwise we devide N1 by 10
Algorithm:spliting_odd_and_even_digits
Variables N,N1,N2,i1,i2,l,d,b:integers
Begin
N1 <- 0
N2 <- 0
L <- N mod 10
D <- L mod 2
If d=0 then
N1 <- l
Elese N2 <- l
End if
i1 <- 1
i2 <- 1
While N>=10 do
N <- N div 10
L <- N mod 10
B<- l mod 2
If b=0 then
Begin
i1 <- i1*10
N1=N1 + l*i1
End
Elese
Begin
i2 <- i2 *10
N2=N2+l*i2
End
End
If d=0 then
N2<-N2/10
Elese
N1<-N1/10
End if
End.