DevJourney · code I wrote while learning

Operations on 2 numbers

2 items

README.md

Single File Programming Question

Problem Statement

You have been assigned a task to create a program that performs arithmetic operations using the Operation class and using inline functions.

You have declared the following inline functions within the class: get(), sum(), difference(), product(), division(), and modulus(). These functions are used to perform various arithmetic operations. Implement the class and its methods as described above.

Then, create an object of the Operation class and demonstrate how the methods can be called to perform the necessary arithmetic calculations. Provide the complete code solution for the program, including the class definition, method implementations, and the main method where the object is created and the methods are called.

Note: This is a sample question asked in a TCS interview.

Input format :

The input consists of two integers, separated by space.

Output format :

The output prints the result of arithmetic operations.

Refer to the sample output for the formatting specifications.

Code constraints :

All inputs should be integers only.

Sample test cases :

Input 1 :

50 8

Output 1 :

Addition of two numbers: 58 Difference of two numbers: 42 Product of two numbers: 400 Division of two numbers: 6 Modulus of two numbers: 2

Input 2 :

120 188

Output 2 :

Addition of two numbers: 308 Difference of two numbers: -68 Product of two numbers: 22560 Division of two numbers: 0 Modulus of two numbers: 120 Whitelist Set 1: Operation void get(); void sum(); void difference(); void product(); void division(); void modulus(); inline