Változók és műveletek
This commit is contained in:
10
Valtozok/Input/Input.csproj
Normal file
10
Valtozok/Input/Input.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>
|
||||||
23
Valtozok/Input/Program.cs
Normal file
23
Valtozok/Input/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
namespace Input
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Felhasználói input");
|
||||||
|
|
||||||
|
Console.Write("Adja meg az első számot:");
|
||||||
|
int szam1=Convert.ToInt32(Console.ReadLine());
|
||||||
|
Console.Write("Adja meg a második számot:");
|
||||||
|
int szam2=Convert.ToInt32(Console.ReadLine());
|
||||||
|
|
||||||
|
int osszeg = szam1 + szam2;
|
||||||
|
Console.WriteLine($"Összeg:{osszeg}");
|
||||||
|
int szorzat = szam1 * szam2;
|
||||||
|
Console.WriteLine($"Szorzat:{szorzat}");
|
||||||
|
double osztas =(double) szam1 / szam2;
|
||||||
|
Console.WriteLine($"Hányados:{osztas}");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<Solution>
|
<Solution>
|
||||||
|
<Project Path="Input/Input.csproj" Id="8ed1142f-6e8b-4cc4-9eda-f68279e4a89b" />
|
||||||
<Project Path="Valtozok/Valtozok.csproj" />
|
<Project Path="Valtozok/Valtozok.csproj" />
|
||||||
</Solution>
|
</Solution>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Console.WriteLine("11b asztali alkalmazások");
|
Console.WriteLine("11b asztali alkalmazások");
|
||||||
int szam1 = 145;
|
int szam1 = 145;
|
||||||
|
|
||||||
uint szam2 = 3376;
|
uint szam2 = 120;
|
||||||
|
|
||||||
Console.WriteLine(szam1);
|
Console.WriteLine(szam1);
|
||||||
|
|
||||||
@@ -26,6 +26,29 @@
|
|||||||
|
|
||||||
Console.WriteLine($"Ushort max:{ushort.MaxValue},Short max:{short.MaxValue}");
|
Console.WriteLine($"Ushort max:{ushort.MaxValue},Short max:{short.MaxValue}");
|
||||||
|
|
||||||
|
long hosszu = 4353454356666546;
|
||||||
|
ulong uhosszu = 3432423434242423234;
|
||||||
|
|
||||||
|
Console.WriteLine($"Long max:{long.MaxValue},Ulong max:{ulong.MaxValue}");
|
||||||
|
|
||||||
|
//Lebegőpontos számok (tört számok)
|
||||||
|
float lebego1 = 67.123456789012345678901234567890f;
|
||||||
|
double lebego2 = 67.123456789012345678901234567890;
|
||||||
|
decimal decimalis = 67.123456789012345678901234567890m;
|
||||||
|
|
||||||
|
Console.WriteLine($"Float:{lebego1}");
|
||||||
|
Console.WriteLine($"Double:{lebego2}");
|
||||||
|
Console.WriteLine($"Decimal:{decimalis}");
|
||||||
|
|
||||||
|
//Szöveg
|
||||||
|
string szoveg = "Valami, bármi, akármi";
|
||||||
|
szoveg = "Csak valami";
|
||||||
|
|
||||||
|
//Logikai
|
||||||
|
bool logikai = true;
|
||||||
|
|
||||||
|
//Karakter ,betű, szám, írásjel, vezérlő karakter
|
||||||
|
char karakter = 'b';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user