Automated grading of homework assignments and tests
- fork this repository
- solve the task
- commit with proper message
- commit with proper message
Create a function called add. Create a function argument x of type int. Create a parameter int type y of type int. return sum of two parameters.
Example 1:
Input: 4, 5
Output: 9
Create a function called divide. Create function arguments a and b of type int. Returns the floor division of a and b.
Example 1:
Input: 4, 2
Output: 0
Create a function called func. Create function arguments a and b of type int. Returns the remainder of a and b.
Example 1:
Input: 5, 3
Output: 2
Create a function called multiple. Create function arguments a and b of type int. Return the multiplication of a and b.
Example 1:
Input: 5, 3
Output: 15
Create a function called func. Create a fucntion argument ‘number’ two digits numbers will be given. return the sum of the number’s digits.
Example 1:
Input: 45
Output: 9
Create a function called func. Create a function argument called ‘number’ of type int the two-digit numbers will be given. Find the reverse of the number and return to a variable called ‘answer’ return answer
Example 1:
Input: 65
Output: 56
Create a function called func. Create a function argument called ‘number’ of type int the three-digit number will be given. Find the ‘number’ first digit and assign to x1. Find the ‘number’ second digit and assign to x2. Find the ‘number’ third digit and assign to x3. Create a variable called ‘answer’ and assign it the sum of the three digits. return the sum of the digits.
Example 1:
Input: 456
Output: 15
Example 2:
Input: a = 0
Output: 0
Create a function called func. Create a function argument called ‘number’ type of int. Create a variable called ‘answer’. Find the remainder of the division of number by 3 and assign it to ‘answer’. return the answer.
Example 1:
Input: 7
Output: 1
Example 2:
Input: a = 8
Output: 9
Create a function called func. Create a function argument called ‘number’ of type int. Find the remainder of the division of number by 2 and assign it to ‘answer’. return the answer.
Example 1:
Input: 7
Output: 1
Example 2:
Input: a = 8
Output: 7
Create a function called func.
Example 1:
Input: a = 5
Output: -5
Example 2:
Input: a = 1
Output: -1
- don't copy other solutions or any solution
- don't remove comments