id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

frew@mclean.com unit4day2 > odd
prev  |  next  |  chance

If the parameter is odd, return 3 times the number plus 1. Otherwise, return the parameter unchanged.


odd(10) → 10
odd(1) → 4
odd(9) → 28

...Save, Compile, Run (ctrl-enter)

public int odd(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy