Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners program on factorial of a given number in java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ravula kartheek
program on factorial of a given number in java
1 Answer(s)      a year and 9 months ago
Posted in : Java Beginners


please tell me, how to write program on factorial of a given number in java?


Advertisement
View Answers

January 24, 2013 at 1:53 PM


hi friend,

You can write a program for getting the factorial of a given number as follows

class Factorial
{
     public static void main(String[] args)
       {
         int a= 5;
           int fact= 1;
         System.out.print("Factorial of " +a+ " = ");   
           int i = 1;
           while(i <= 5)
            {
                fact = fact*i;
                i++;
            }
           System.out.println(fact);
       }
}

For detail tutorial you can go through the following link Write a program to calculate factorial of any given number



Related Tutorials/Questions & Answers:
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
Advertisements
Write a program to calculate factorial of any given number
program to calculate factorial of any given number. First of all define a class... Factorial Examples - Java Factorial Example to calculate factorial of any given number      
Write a program to find a factorial in any given number
Write a program to find a factorial in any given number This programming tutorial will teach you how to write a factorial of any given number... the factorial of any given number import java.util.Scanner; class
Factorial Program in Java
Factorial program in Java helps programmer to write factors of any given... exception". Example of Factorial program in Java: import java.io.*; class... execution of the program. BufferReader is defined under the Java I/O package
Java Swing Compute Factorial
Java Swing Compute Factorial In this section, we are going to find the factorial of a given number. Here an user is allowed to enter a number into the text...("Factorial of Input Number: "); t1 = new JTextField(20); t2 = new
Calculate factorial of a number.
Calculate factorial of a number.  How to calculate factorial of a given number?   import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Factorial { public static
program for factorial
program for factorial  how to set size of buttons on frame
program for factorial
program for factorial  how to set size of buttons on frame
Prime Number program in Java
Prime Number program in Java will print the prime numbers between 1 to any given number. Prime Number is a number that is not divisible by any number other... program in Java: package Tutorial; public class PrimeNumber { public static
factorial - Java Beginners
factorial Example in Java  The factorial method is used frequently in probability problems. The factorial of a positive integer n (written as n!) is equal... class Factorial Example{ public static long factorial(int n){ if(n <
find factorial of any number using recursion
find factorial of any number using recursion  error in 14 line ; expected int rec( int a) ^ how to resolve this.please correct the code. import...)); System.out.println(?enter number?); int x=Integer.parseInt(br.readLine()); int result
Magic number Java Program
Magic number Java Program  write a program that guesses what number the user is thinking of. Below is a sample transcript: Think of a number between 1 and 255. I will guess the number you are thinking of. 1 3 5 7 9 11 13 15 17
Finding a Factorial using while loop
find a factorial of a number by using the temp variable which will help us to calculate the factorial of a number. Take one variable factorial of int type...; factorial* temp and keep on decreasing the value of temp by l. Code of the Program
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
Please provide the java code for the given program.
Please provide the java code for the given program.   We need an application for managing an educational institute. That application should provide...: StudentAddr: StudentDob: Email: Course ALL Java C C++ Oracle Fees: Duration: Faculty
Java Automorphic number program - Java Beginners
Java Automorphic number program  Write a program to read a positive... void main(String args[]){ System.out.print("Enter any number...){ if ((n*n) % d == n){ System.out.println("Automorphic Number
Prime number program in java
Prime number program in java In this example you will learn how to write a program to generate and check  prime number  in java. As we know prime number are those number which are divisible by 1 or itself, first define
write a java program for inserting a substring in to the given main string from a given position
write a java program for inserting a substring in to the given main string from a given position  write a java program for inserting a substring in to the given main string from a given position
Write a java program to display the season given the month using switch case
Write a java program to display the season given the month using switch case  Write a java program to display the season given the month using switch case
Prime Number in Java
Prime Number in Java In this Java tutorial , you will learn how to write a Java program to get prime numbers between 1 to the desired number. To start... prime number. ADS4ThUnitADS Here is the code of the java Program to get prime
Finding a Factorial using while loop
used to write the content on the browser. We can find a factorial of a number... of a number. Take one variable factorial of int type and initialize it as 1. Take...; The output of the program is given below
Write a program that converts any given year to Roman Numeral in Java
Write a program that converts any given year to Roman Numeral in Java  Write a program that converts any given year to Roman Numeral
a program in java to generate the powerset of a given set - Java Beginners
a program in java to generate the powerset of a given set  Hello :) am a fresher to java i am in need of a java code which generates the powerset of a given set i.e suppose the set S be {a,b,c} the power set would
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
java program to check whether a number is pallindrome or not using recursion???????
java program to check whether a number is pallindrome or not using recursion???????  java program to check whether a number is pallindrome or not using recursion
Advertisements
 

 

 

DMCA.com