Operators of JAVA
public class TwoNumOps
{
public static void main ( String args[ ] )
{
double x = 5.0 ;
double y = 3.0 ;
System.out.println ("x + y = " + ( x + y ) );
System.out.println ("x - y = " + ( x - y ) );
System.out.println ("x * y = " + ( x * y ) );
System.out.println ("x / y = " + ( x / y ) );
System.out.println ("x % y = " + ( x % y ) );//To obtain re--mainder.
}
}
No comments:
Post a Comment