Created
October 18, 2022 00:20
-
-
Save isobarbaric/c1bddb01f1fd38f88b97f711bef65376 to your computer and use it in GitHub Desktop.
Java Solution - CS Problem of the Week #1 (2022-2023)
This file contains hidden or 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
| /* | |
| * Avinash Anand | |
| * October 17, 2022 | |
| * This program will print out the times table from 1 to 12, and the if statements format the table. | |
| */ | |
| package cssolution1; | |
| public class Cssolution1 { | |
| public static void main(String[] args) { | |
| int num = 0; | |
| for(int i = 1; i <= 12; i++){ | |
| for(int j = 1; j <= 12; j++){ | |
| num = i * j; | |
| if(num < 10){ | |
| System.out.print(num + " "); | |
| } else if(num >= 10 && num < 100){ | |
| System.out.print(num + " "); | |
| } else if(num >= 100){ | |
| System.out.print(num + " "); | |
| } | |
| } | |
| System.out.println(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment