Programming in Java
Object Oriented in Java
Advanced topics in Java
Modal Box
Tutorials
C is a very powerful and widely used language. It is used in many scientific programming situations. It forms (or is the basis for) the core of the modern languages Java and C++. It allows you access to the bare bones of your computer.C++ is used for operating systems, games, embedded software, autonomous cars and medical technology, as well as many other applications. Don't forget to visit this section...
Input Output in java
In java, all input classes are imported in package java.io
Program to take input as runtime and calculate the factorial :
import java.io.*
class Factorial
{
public static void main(String args[])
{
try
{
InputStreamReader in=new InputStreamReader(System.in);
BufferedReader br= new BufferedReader(in);
System.out.println("enter the number ");
int n=Integer.parseInt(br.readLine());
int f=1;
while(n>0)
{
f=f*n;
n--;
}
System.out.println("the factorial is"+f);
}
catch(Exception ex){
System.out.println("the exception is"+ex);
}
}
}
Video/ C Introduction
Watch video in full size