R Programs to Add, Sub, Mul, and Div

R Programs to Add, Sub, Mul, and Div

Input:

2+3 //Add
2-3 //Sub
2*3 //Mul
2/3 //Div
2+2+3*4-4/3 // Add, Mul, Sub, Div

Output:

5
[1] -1
[1] 6
[1] 0.6666667
[1] 14.66667

(Or)

With input variable:

x=6 
y=2 
x + y
x-y
x*y
x/y

Output:

8
4
12
3