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
24 changes: 23 additions & 1 deletion FizzBuzz/FizzBuzz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
for (int i = 1; i <= 100; i++)
{
//Checks if divisible by 3 and 5
if (i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
//Checks if divisible by 3
else if (i % 3 == 0)
{
Console.WriteLine("Fizz");
}
//Checks if divisible by 5
else if (i % 5 == 0)
{
Console.WriteLine("Buzz");
}
//If neither print number
else
{
Console.WriteLine(i);
}
}
}
}
}
27 changes: 27 additions & 0 deletions HelloWorld/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/HelloWorld.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions HelloWorld/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/HelloWorld.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
6 changes: 5 additions & 1 deletion HelloWorld/HelloWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("Hello Sam!");
string yourName = Console.ReadLine();
Console.Write("Hello ");
Console.Write(yourName);
}
}

}