Skip to content

Instantly share code, notes, and snippets.

@KcPele
Created October 7, 2022 05:29
Show Gist options
  • Save KcPele/ac9c05a61673f6e86fc5aa7211eab793 to your computer and use it in GitHub Desktop.
Save KcPele/ac9c05a61673f6e86fc5aa7211eab793 to your computer and use it in GitHub Desktop.
task1
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