โ Back to Methods
Question 351
Half of a Number Method
Half of a Number Method
Write a methodhalf(int n)that returnsndivided by 2 using integer division. Call it with50and print the result: 25 UseSystem.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.