RND
This commit is contained in:
parent
ddc33e2beb
commit
95d3a2be13
4 changed files with 82 additions and 1 deletions
24
Emne 3/ConsoleApp5/Random/Program.cs
Normal file
24
Emne 3/ConsoleApp5/Random/Program.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
namespace Random
|
||||
{
|
||||
class Random
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
System.Random rnd = new System.Random();
|
||||
int randomnr = rnd.Next(0, 3);
|
||||
if (randomnr == 0)
|
||||
{
|
||||
Console.WriteLine("Tallet ble 0");
|
||||
}else if (randomnr == 1)
|
||||
{
|
||||
Console.WriteLine("Tallet ble 1");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Tallet ble 2");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
10
Emne 3/ConsoleApp5/Random/Random.csproj
Normal file
10
Emne 3/ConsoleApp5/Random/Random.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue