Murali Reddy
Splitting An Integer By Using Recursive Function.
By Murali Reddy in ASP.NET on Oct 10 2013
  • Aman Jain
    Oct, 2013 23

    I think, u need to use "while(num>0)" instead of "if(num>0)".

    • 0
  • Murali Reddy
    Oct, 2013 10

    public class Sample

    {
    public static int num=123456789;
    public static void main()
    {
    split(num);
    console.readkey();
    }
     public static void split(int num)
            {
                if(num>0)
                {
                    split(num / 10);
                    Console.WriteLine(num % 10);
                }
            }
    }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS