Here i will give method for displaying reverse of Integer value using C#.net
ReverseValue is a method for display reverse of integer.
ReverseValue is a method for display reverse of integer.
public static string ReverseValue(int value)
{
int reverse = 0;
while (value > 0)
{
int rem = value % 10;
reverse = (reverse * 10) + rem;
value = value / 10;
}
result =reverse.ToString();
return result;
}
Call method :{
int reverse = 0;
while (value > 0)
{
int rem = value % 10;
reverse = (reverse * 10) + rem;
value = value / 10;
}
result =reverse.ToString();
return result;
}
string str = DerivedClass.ReverseValue(123456789);
MessageBox.Show(str.ToString());
MessageBox.Show(str.ToString());