Függvények ismétlése
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -14,13 +14,41 @@
|
|||||||
Console.WriteLine(szoveg);
|
Console.WriteLine(szoveg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Kiir(string szoveg1, string szoveg2) {
|
||||||
|
|
||||||
|
Console.WriteLine(szoveg1+" "+szoveg2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//visszatérési értékkel rendelkező függvény
|
||||||
|
static int Osszead(int a,int b)
|
||||||
|
{
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static double Osszead(double a, double b) {
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Írjon egy függvényt, amely három paramétert kap híváskor (ev,honap,nap)
|
||||||
|
//A függvény egy string-típusú dátum értéket adjon vissza, pl. 2014.10.15
|
||||||
|
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Hello, World!");
|
Console.WriteLine("Hello, World!");
|
||||||
Kiir();
|
Kiir();
|
||||||
Kiir("Bármi");
|
Kiir("Bármi");
|
||||||
|
Kiir("Kiss", "Elek");
|
||||||
|
|
||||||
|
Console.WriteLine(Osszead(12, 45));
|
||||||
|
int osszeg = Osszead(34, 78);
|
||||||
|
Console.WriteLine(osszeg);
|
||||||
|
|
||||||
|
Console.WriteLine(Osszead(12.67, 45.3345));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user