C# változók
This commit is contained in:
3
Valtozok/Valtozok.slnx
Normal file
3
Valtozok/Valtozok.slnx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<Solution>
|
||||||
|
<Project Path="Valtozok/Valtozok.csproj" />
|
||||||
|
</Solution>
|
||||||
32
Valtozok/Valtozok/Program.cs
Normal file
32
Valtozok/Valtozok/Program.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
namespace Valtozok
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("11b asztali alkalmazások");
|
||||||
|
int szam1 = 145;
|
||||||
|
|
||||||
|
uint szam2 = 3376;
|
||||||
|
|
||||||
|
Console.WriteLine(szam1);
|
||||||
|
|
||||||
|
//byte típus
|
||||||
|
byte kisSzam = 255;
|
||||||
|
|
||||||
|
Console.WriteLine(Convert.ToString(kisSzam,2).PadLeft(8,'0'));
|
||||||
|
Console.WriteLine(Convert.ToString(szam1, 2).PadLeft(32, '0'));
|
||||||
|
|
||||||
|
//short
|
||||||
|
short kozepes = 56;
|
||||||
|
ushort masikKozepes = 45;
|
||||||
|
|
||||||
|
Console.WriteLine(ushort.MaxValue);
|
||||||
|
Console.WriteLine(short.MaxValue);
|
||||||
|
|
||||||
|
Console.WriteLine($"Ushort max:{ushort.MaxValue},Short max:{short.MaxValue}");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
Valtozok/Valtozok/Valtozok.csproj
Normal file
10
Valtozok/Valtozok/Valtozok.csproj
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user