Write a program in JAVA to preform Arithmetic Operation.

The Arithmetic Operation are Addition, Multiplication, Division, Subtraction. It is demonstrated below using java.


/* Arithmetic Operation Using Java */
class ArithOp {
public static void main(String args[]) {
int num1,num2,Add,Mul,Div,Sub;
num1 = 200;
num2 = 100;
System.out.println(" This is num1: "+num+" and num2: "+num2);
Add = num1 + num2;
Mul = num1 * num2;
Div = num1 / num2;
Sub = num1 - num2;
System.out.println("Addition =" +Add);
System.out.println("Multiplication =" +Mul);
System.out.println("Division =" +Div);
System.out.println("Subtraction =" +Sub);
}
}


Output:
This is num1: 200 and num2: 100
Addition = 300
Multiplication = 200
Division = 2
Subtraction = 100

0 comments:

Post a Comment

 

About Me

It's Me!Hi, I'm Moinuddin. I'm a Software Engineer at WIPRO working on Microsoft .NET Technology. I'm interested in a wide range of technology topics, mainly Microsoft including Windows Azure, WCF, WPF, Silverlight and any other cool technology that catches the eye.

Site Info

ProjectCSharp.com is mainly about demonstrating real time examples in different technologies like ASP.NET, WCF, WPF, Silverlight, Azure etc..,

Followers

Help Links

Project CSharp (C#) Copyright © 2011. All Rights Reserved.