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
int hero_pos = 0; | |
int one = rand()% 9 + 1; | |
int two = rand() % 9 + 1; | |
int three = rand() % 9 + 1; | |
while (one == two || one == three || two == three) | |
{ | |
one = rand()% 9 + 1; | |
two = rand() % 9 + 1; | |
three = rand() % 9 + 1; |
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
int i = 1; | |
do | |
{ | |
System.out.println(i); | |
i+=2; | |
} while (i <= 1001); |
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
int i = 1; | |
while (int i <= 1001) | |
{ | |
System.out.println(i); | |
i+=2; | |
} |
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
int i = 1; | |
while (int i <= 1001) | |
{ | |
} |
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
for (int i = 1; i <= 1001; i += 2) | |
{ | |
System.out.println(i); | |
} |
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
int x = 2**2; | |
if(x > 4) | |
{ | |
System.out.println("Does this work?"); | |
} | |
else if(x % 2 == 1) | |
{ | |
System.out.println("Does this work?"); | |
} | |
else |
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
int x = 2**2; | |
if(x > 4) | |
{ | |
System.out.println("Does this work?"); | |
} | |
else if(x % 2 == 0) | |
{ | |
System.out.println("Does this work?"); | |
} |
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
int x = 2**2; | |
if(x > 4) | |
{ | |
System.out.println("Does this work?"); | |
} | |
int i = 9; | |
if(i % 2 == 1) | |
{ | |
System.out.println("Does this work?"); | |
} |
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
int i = 1; | |
if (i < 2) | |
{ | |
System.out.println("This is an if statement that works"); | |
} | |
int i = 4; | |
if (i < 2) | |
{ | |
System.out.println("This is an if statement that doesn't works"); | |
} |
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
public class HelloWorld | |
{ | |
public void HelloWorld() | |
{ | |
System.out.println("Hello World"); | |
} | |
public static void main(String[] args) | |
{ | |
HelloWorld hw = new HelloWorld(); | |
} |
NewerOlder