CJCoding With Joseph

Half of a Number Method

Write a method half(int n) that returns n divided by 2 using integer division. Call it with 50 and print the result:

25

Use System.out.println. Do not hardcode 25.

Expected Output:

25
Topics:
Methods
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.