Created with <3 with dartpad.dev.
Created
October 7, 2022 05:29
-
-
Save KcPele/ac9c05a61673f6e86fc5aa7211eab793 to your computer and use it in GitHub Desktop.
task1
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
void main() { | |
//setting the range of numbers to generate | |
int num = 30; | |
//the for loop is generating the numbers from 1 to 30 inclusive that is why i added 1 to 30 | |
for (int i = 1; i < num + 1; i++) { | |
if(i % 2 != 0){ | |
print(i); | |
} else if (i == num){ | |
print("The number is at $i"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment