The teacher has given the assignment to find the sum of 2 numbers. But the code should not contain the ‘+’ operator. What is to be done?

Phương Linh

New member
The teacher has given the assignment to find the sum of 2 numbers. But the code should not contain the ‘+’ operator. What is to be done?
A. Use a function
B. Add the values and print the sum directly
C. Use an expression
D. Cannot be done
 
Answer: a
Explanation: The power of a function is to hide the statements which are used to complete our task. So the student can create a function file to add two numbers. Hence, the code will not show the ‘+’ operator but it will be used implicitly.
 

Tìm kiếm

Back
Top