0% found this document useful (0 votes)
13 views2 pages

Java OOPs: Basic Arithmetic Operations

The document presents a Java program that accepts three numbers via command line arguments and performs basic arithmetic operations: addition, subtraction, multiplication, and division. The program outputs the results of these operations. It includes a sample output with the author's name and course details.

Uploaded by

thisisdurvesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Java OOPs: Basic Arithmetic Operations

The document presents a Java program that accepts three numbers via command line arguments and performs basic arithmetic operations: addition, subtraction, multiplication, and division. The program outputs the results of these operations. It includes a sample output with the author's name and course details.

Uploaded by

thisisdurvesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

F.y.

bca Sem 2 oops using java

PRACTICAL NO.1-A
QUESTION-WAP ton accept three numbers from the using and display
addition,subtraction,multiplication and division of numbers using command line
arguements

Code:-
class P1a
{
public static void main(String args[])
{
[Link]("MANSI SHUKLA KCFYBCA52");
[Link]("------------------------------------------------");

int n1,n2,n3;

n1=[Link](args[0]);
n2=[Link](args[1]);
n3=[Link](args[2]);

int a=n1+n2+n3;
int s=n1-n2-n3;
int m=n1*n2*n3;

int d=n1/n2;

[Link]("Addition="+a);
[Link]("Subtraction="+s);
[Link]("Multiplication="+m);
[Link]("Division="+d);
}
}

Output:-

Mansi Shukla kcfybca52


[Link] Sem 2 oops using java

Mansi Shukla kcfybca52

You might also like