Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created May 12, 2023 15:26
Show Gist options
  • Save suhailgupta03/29558e388b7de686b8f4eaf97533dc94 to your computer and use it in GitHub Desktop.
Save suhailgupta03/29558e388b7de686b8f4eaf97533dc94 to your computer and use it in GitHub Desktop.
var x = 2; // Initialization
while(x <= 100) { // Condition
if(x % 2 == 0) { // % gives the remainder
// this means that the number
// is EVEN
console.log(x);
}
x = x + 1; // Updating the state
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment