Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
<<<<<<< HEAD
"code-runner.runInTerminal": true
}
=======
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
>>>>>>> 2118b04ef028da4def9257e6799e4118d96f1eb2
7 changes: 7 additions & 0 deletions ndtask/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
18 changes: 18 additions & 0 deletions ndtask/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Getting Started

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

## Folder Structure

The workspace contains two folders by default, where:

- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the `bin` folder by default.

> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management

The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
Binary file added ndtask/bin/NDTASK.class
Binary file not shown.
Binary file added ndtask/src/NDTASK.class
Binary file not shown.
32 changes: 32 additions & 0 deletions ndtask/src/NDTASK.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.util.Scanner;

public class NDTask {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.println("Enter the first number:");
int n1 = scanner.nextInt();
scanner.nextLine(); // Consume newline character

System.out.println("Enter the second number:");
int n2 = scanner.nextInt();
scanner.nextLine(); // Consume newline character

int max;

if (n1 > n2) {
max = n1;
} else if (n2 > n1) {
max = n2;
} else {
System.out.println("Both numbers are equal.");
scanner.close();
return;
}

System.out.println("The maximum of " + n1 + " and " + n2 + " is: " + max);

scanner.close();
}
}