EFFICIENT CALCULATION OF THE SUM OF NATURAL NUMBERS USING A WHILE LOOP IN JAVA
Authors:
M Naresh
, K Naga Vihari
, Muli Annapurna 
DOI: https://doi.org/10.37082/IJIRMPS.v14.i1.232900
Short DOI: https://doi.org/hbnbz6
Country: India
Full-text Research PDF File:
View |
Download
Abstract: The calculation of the sum of natural numbers is a fundamental problem in computer science and mathematics. This study focuses on implementing a while loop in Java to compute the sum of natural numbers up to a given integer n. The iterative approach ensures simplicity and clarity, suitable for beginners learning programming concepts. We provide an analysis of the algorithm, evaluate its performance, and demonstrate its application with example outputs. This paper emphasizes the efficiency of the approach and its relevance to foundational programming education.
Keywords: While loop, Iterative programming, Java programming, Algorithm design, Programming education
Paper Id: 232900
Published On: 2026-01-23
Published In: Volume 14, Issue 1, January-February 2026
All research papers published in this journal/on this website are openly accessible and licensed under