School Accuracy: 33.92% Submissions: 109 Points: 0
Given two numbers A and B. Perform addition,multiplication, subtraction and division on these two numbers.
Input: A = 1, B = 2
Output: 3 2 1 2
A + B = 3
A * B = 2
Since B>A, therefore the result of
subtraction and division are
B - A = 1 and B / A = 2 respectively.
Input: A = 5 B = 7
Output: 12 35 2 1
A + B = 12
A * B=35
Since B>A, therefore results of subtraction
and division are B - A = 2 and B / A = 1.
You don't need to read input or print anything.Your task is to complete the function cppOperator() which takes two integers A and B as input parameters and returns a vector containing the results of addition,multiplication,subtraction and division of the two numbers.
Expected Time Complexity:O(1) Expected Auxillary Space:O(1)