Looping with Numbers HackerRank Solution

Hello Programmers, In this post, you will know how to solve the Looping with Numbers HackerRank Solution. This problem is a part of the HackerRank Linux Shell Series.

Looping with Numbers HackerRank Solution
Looping with Numbers HackerRank Solutions

One more thing to add, don’t directly look for the solutions, first try to solve the problems of Hackerrank by yourself. If you find any difficulty after trying several times, then you can look for solutions.

Ezoicreport this adProblem

Use a for loop to display the natural numbers from 1 to 50.

Input Format

There is no input

Output Format

1
2
3
4
5
.
.
.
.
.
50

Looping with Numbers HackerRank Solutions

#!/bin/bash
for i in {1..50}
do
    echo $i
done

Note: This problem (Looping with Numbers) is generated by HackerRank but the Solution is Provided by  BrokenProgrammers. This tutorial is only for Educational and Learning purposes.

Next: The World of Numbers HackerRank Solution

Sharing Is Caring

Leave a Comment

Ezoicreport this ad