Morash
04-17-2014, 01:19 AM
Calculator Using if Statement In Java
The if statement Is Used To Execute Or Ignore A Set Of Statements After Testing A Give Condition.
If The Given Condition Is True The Following Statement Will Be Executed Otherwise Will Be Ignored
And The Control Will Transfer To The Next Statement.
Syntax
if(condition)
{
Statement;
}
Example
http://i59.tinypic.com/2vmgcib.jpg
Output
Addition
http://i61.tinypic.com/2n9yomp.jpg
Subtraction
http://i60.tinypic.com/2rmkx8p.jpg
Multiplication
http://i62.tinypic.com/xkobro.jpg
Division
http://i59.tinypic.com/2aewjd0.jpg
The if statement Is Used To Execute Or Ignore A Set Of Statements After Testing A Give Condition.
If The Given Condition Is True The Following Statement Will Be Executed Otherwise Will Be Ignored
And The Control Will Transfer To The Next Statement.
Syntax
if(condition)
{
Statement;
}
Example
http://i59.tinypic.com/2vmgcib.jpg
Output
Addition
http://i61.tinypic.com/2n9yomp.jpg
Subtraction
http://i60.tinypic.com/2rmkx8p.jpg
Multiplication
http://i62.tinypic.com/xkobro.jpg
Division
http://i59.tinypic.com/2aewjd0.jpg