Skip to content
DATA STRUCTURE
DATA STRUCTURE

Learn everything about Data structure

  • Algorithms
  • DSA
  • Array
  • Stack
  • Queue
  • Matrix
  • Programs
DATA STRUCTURE

Learn everything about Data structure

Algorithm to print the series 1 to N using while loop

YASH PAL, September 24, 2022March 6, 2023

In this tutorial, we are going to write an algorithm to print the series of 1 to N using a while loop. using this algorithm we can write a program to print the series 1 to N using a while loop in most programming languages like java python c++ and c programming.

[br]

Algorithm to print the series 1 to N using a while loop.

1. Read N.
2. Set I:=1
3. Repeat Steps 4 and 5 While I <= N:
4.       Write I.
5.       Set I:=I+1.
6. [End of Step 3 loop]
7. Exit.
[br]
Here in the above algorithm, we first read an integer variable N and then set the initial value of another variable I to 1. and then using the while loop we will execute steps 4 and step 5. means first we will write the value of the I variable to the output screen and then Set the value of I to I + 1. these two step will execute till the value of I become equal to N. and then we will exit from the program.
[br]
Also, Read
  1. Algorithm to Add [Sum] two numbers
  2. Algorithm to Find Maximum of Two Numbers
  3. Algorithm to Find Maximum of Three Numbers
  4. Algorithm to Input percentage From user and Print grade
  5. Algorithm to Print the Series 1 to N using for loop
  6. Algorithm to Print the Series 1 to N using Do While loop
  7. Algorithm to Reverse a given Number
  8. Algorithm to Find Whether a Number is Prime or Not
  9. Algorithm for Linear Search in Array
  10. Algorithm to Calculate Factorial using Function
algorithms algorithm

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • About US
  • Contact US
  • Data Structures and algorithms tutorials
  • Digital Communication Tutorials
  • DMCA
  • HackerRank All Algorithms problems solutions
  • HackerRank C problems solutions
  • HackerRank C++ problems solutions
  • HackerRank Java solutions
  • HackerRank Python solutions
  • Human Values Tutorials
  • Internet of Things Tutorials
  • Privacy Policy
©2025 DATA STRUCTURE | WordPress Theme by SuperbThemes