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

 

specialSumThree


Given 3 int values, a b c, return their sum. However, if any of the values is a teen -- in the range 13..19 inclusive -- then that value counts as 0. Also, if all three int values are equal, then return 0.


specialSumThree(1, 2, 3) → 6
specialSumThree(13, 5, 10) → 15
specialSumThree(4, 4, 4) → 0

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

public int specialSumThree(int a, int b, int c){ }

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