javaprograms

javaprograms

write program

s=1x3x5x...........x17

View Answers

September 9, 2011 at 4:07 PM

import java.math.*;
class NumberExample 
{
    public static void main(String[] args) 
    {
        BigInteger p=new BigInteger("1");
        int m=0;
        for(int i=1; i<=17; i+=2){
        BigInteger n = BigInteger.valueOf(i);
        p=p.multiply(n);
        System.out.print(i+" ");
        }
        System.out.println();
        System.out.println(p);
    }
}









Related Tutorials/Questions & Answers:
javaprograms
javaprograms
Advertisements
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms - Java Beginners
javaprograms - Java Beginners
javaprograms - Java Beginners

Ads