> if statement java ~ Online tutorial

if statement java

The if Statement
The if  statement allows conditional execution of a statement or a conditional
choice of two statements, executing one or the other but not both.
Syntax:


if ( Expression ) Statement
IfThenElse Statement:
if ( Expression ) StatementNoShortIf else Statement
IfThenElseStatementNoShortIf:
if ( Expression ) StatementNoShortIf else StatementNoShortIf

The Expression must have type boolean or Boolean, or a compile-time error
occurs.

Program
import java.io.*;
public class ifdat
{
public static void main(String args[])throws IOException
{
BufferedReader in=new BufferedReader(System.in);
InputStreamReader text=new InputStraemReader(in);
System.out.println("enter the salary");
String m=in.readLine();
int n=Integer.parseInt(m);
if(m<=1000)
{
int bon=m*.10;
System.out.println("bonus"+bon);
}
}
}

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: