Thursday, 1 March 2018

While Loop in Java with Factorial Program example







package javaapplication6;





public class JavaApplication6 {



   

    public static void main(String[] args)

    {

      int fac=1;

        int i=25,temp;

        temp=i;

        while(i>=1)

        {

        fac=fac*i;

        i--;   

        }

       

        System.out.println(temp+"!="+fac);

    }

   

}



No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...