Created
October 4, 2022 15:05
-
-
Save devvspaces/9cb4263c4a19d8ce2f63ee6766e221b2 to your computer and use it in GitHub Desktop.
Program to print odd numbers ranging from 1 - 30 π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Program to print odd numbers ranging from 1 - 30 π | |
| void main() { | |
| // Loop on numbers range 1 - 30 | |
| for (int pointer = 1; pointer <= 30; pointer++){ | |
| // Check if value is an odd number or even | |
| if (pointer % 2 != 0) { | |
| print(pointer); | |
| continue; | |
| } | |
| if (pointer == 30){ | |
| print("The number is at $pointer"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment