sum app
This commit is contained in:
parent
343a9bc318
commit
907cd1a608
|
@ -2,23 +2,17 @@ namespace ConsoleApp2;
|
|||
|
||||
public class NewClass
|
||||
{
|
||||
private int tall = 1;
|
||||
private float desimalTall = 1.0f;
|
||||
double desimalTall2 = 1.01;
|
||||
decimal desimalTall3 = 1.01M;
|
||||
public static int nummer = 1;
|
||||
public static long langt = 1234567890;
|
||||
public static float flytende = 5.5f;
|
||||
public static decimal desimal = 1.5m;
|
||||
public static double dobbel = 1.5;
|
||||
public static string streng = "Bokstaver og ord";
|
||||
public static char karakter = 'A';
|
||||
public static bool santUsant = false;
|
||||
|
||||
char bokstav = 'A';
|
||||
string tekst = "Hei";
|
||||
|
||||
bool santUsant = true; //eller false
|
||||
|
||||
int[] tallArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
||||
string[] tekstArray = { "A", "B", "C", "D", "E" };
|
||||
|
||||
List<int> ListeMedTall = new List<int>();
|
||||
|
||||
public int NumberFive()
|
||||
public string NumberFive()
|
||||
{
|
||||
return 5;
|
||||
return "fem";
|
||||
}
|
||||
}
|
|
@ -7,7 +7,11 @@ internal class Program
|
|||
Console.WriteLine("Hei, hva heter du?");
|
||||
var input = Console.ReadLine();
|
||||
Console.WriteLine($"Velkommen {input}!");
|
||||
Console.WriteLine(NewClass.bokstav);
|
||||
Console.WriteLine($"{NewClass.nummer}");
|
||||
Console.WriteLine($"{NewClass.flytende}");
|
||||
Console.WriteLine($"{NewClass.desimal}");
|
||||
Console.WriteLine($"{NewClass.dobbel}");
|
||||
Console.WriteLine($"{NewClass.streng}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
16
Emne 3/ConsoleApp3/ConsoleApp3.sln
Normal file
16
Emne 3/ConsoleApp3/ConsoleApp3.sln
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp3", "ConsoleApp3\ConsoleApp3.csproj", "{0F0F3523-8CAA-4458-BC02-5F3BF326548F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0F0F3523-8CAA-4458-BC02-5F3BF326548F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0F0F3523-8CAA-4458-BC02-5F3BF326548F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0F0F3523-8CAA-4458-BC02-5F3BF326548F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0F0F3523-8CAA-4458-BC02-5F3BF326548F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
10
Emne 3/ConsoleApp3/ConsoleApp3/ConsoleApp3.csproj
Normal file
10
Emne 3/ConsoleApp3/ConsoleApp3/ConsoleApp3.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>
|
13
Emne 3/ConsoleApp3/ConsoleApp3/Program.cs
Normal file
13
Emne 3/ConsoleApp3/ConsoleApp3/Program.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
namespace ConsoleApp3
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int a = 3;
|
||||
decimal b = 5;
|
||||
decimal sum = a + b;
|
||||
Console.WriteLine(sum);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue