Skip to content

Instantly share code, notes, and snippets.

@singhrahuldps
Last active April 27, 2020 13:37
Show Gist options
  • Select an option

  • Save singhrahuldps/17c27ff4e071ae0dc64131f47fa19d31 to your computer and use it in GitHub Desktop.

Select an option

Save singhrahuldps/17c27ff4e071ae0dc64131f47fa19d31 to your computer and use it in GitHub Desktop.
// Program to print first 10 odd numbers using while loop
int i = 1, count = 0;
while(count != 10) {
if(i%2==1) {
count++;
System.out.printf("%d ", i);
}
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment