This file contains 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
// Addition Function | |
int addition(int num1, int num2) { | |
return (num1 + num2); | |
} | |
// Subtraction Function | |
int subtraction(int num1, int num2) { | |
return (num1 - num2); | |
} |
This file contains 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(){ | |
int odd = 1; | |
// looping through a number ranging from 1 - 30; | |
for (; odd <= 30; odd++){ | |
// check if it is an odd number | |
if ((odd % 2) != 0){ | |
// Printing the result. | |
print("The number is at $odd"); | |
} |