Hello Programmers, In this post, you will know how to solve the Looping and Skipping HackerRank Solution. This problem is a part of the HackerRank Linux Shell Series.
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.
Problem
Your task is to use for loops to display only odd natural numbers from 1 to 99.
Input Format
There is no input.
Constraints
–
Output Format
1
3
5
.
.
.
.
.
99
Sample Input
–
Sample Output
Explanation
–
Looping and Skipping HackerRank Solutions
#!/bin/bash for i in {1..99..2} do echo $i done
Note: This problem (Looping and Skipping) is generated by HackerRank but the Solution is Provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes.