Hello
i want code for reverse number in c# from number A to number B
for Example : 101 ~ 105 (101-102-103-104-105)
( a = 101 , b = 105 )
reverse number: 101 , 201 , 301 , 401 ,501
and i know this code only for reverse one number
int a = Convert.ToInt16(txt1.Text);
while (a != 0)
{
r = r * 10 + (a % 10),r=0;
a = a / 10;
}
now what can i do ?
Regards.
--------------------------
i want complete code ! i think i need to use from "for" but i don't know how :D i test this
int a = Convert.ToInt16(txt1.Text), b = Convert.ToInt16(txt2.Text);
int r = 0;
for (int i = a; i <= b; i++)
{
while (a != 0)
{
r = r * 10 + (a % 10);
a = a / 10;
}
lblshow.Text += r + " , ";
}
but this is not work ...!!! :(
for Example :
a = 101 in textbox1
and
b = 105 in textbox2
and i want show in lbl
101 , 201 , 301 , 401 , 501