Java

Java - for Statement

Java - for Statement
import java.io.*; 

class ssvfor 
{ 
public static void main(String arg[]) throws IOException 
{ 
System.out.print("\nEnter the Number : "); 

DataInputStream dr = new DataInputStream(System.in); 

String t; 

t = dr.readLine(); 

int i,n,f; 
f=1; 

n = Integer.parseInt(t); 

for(i=1;i<=n;i++) 
{ 
f = f*i; 
} 
System.out.println("\nFactorail of Given number "+n+" is : "+f); 

} 
}
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.