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

 

james.shockey@austinisd.org > sumOddSeries
prev  |  next  |  chance

LASA_AP_WhileLoop_Set01_Problem02

Problem 2: Sum of Odd Numbers in a Series
Problem: Given a positive integer n, use a while loop to sum and return all odd numbers from 1 up to n (inclusive).


sumOddSeries(5) → 9
sumOddSeries(10) → 25
sumOddSeries(1) → 1

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

public int sumOddSeries(int n) { }

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

Copyright Nick Parlante 2017 - privacy