International Journal of Innovative Research in Engineering & Multidisciplinary Physical Sciences
E-ISSN: 2349-7300Impact Factor - 9.907

A Widely Indexed Open Access Peer Reviewed Online Scholarly International Journal

Call for Paper Volume 14 Issue 1 January-February 2026 Submit your research for publication

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

Share this