Comp

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

package pkg; import java .io.*; class comp { int n,i,f=1; DataStreamInput ds=new DataStreamInput(System.

in); public void c1() { System.out.print("\n enter no:- ") n=Integer.parseInt(ds.readLIne()); } public static void main(String args[]) { comp c=new comp(); c.c1(); for(i=0;i<n;i++) f=f*i; System.out.println("factorial="+f); } }

You might also like