Skip to content

Commit

Permalink
create if-condition #6
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-becker-ta committed Sep 15, 2022
1 parent 90ac884 commit d614774
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions beginning/beginning/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Wie heißt du ?");
string userName = Console.ReadLine();

Console.WriteLine("Hello " + userName);

Console.WriteLine("Wie alt bist du aktuell?");
Console.WriteLine("Wie alt bist du?");
int age = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Wie alt bist du in X Jahren?");
int nextYear = Convert.ToInt32(Console.ReadLine());
int sumYears = age + nextYear;
Console.WriteLine("Du bist also in "+ nextYear + " Jahren, " + sumYears );
if (age < 18)
{
Console.WriteLine("Du kommscht hier net rein!");
}
else
{
Console.WriteLine("Viel Spaß!");

}
Console.ReadLine();
}
}
Expand Down

0 comments on commit d614774

Please sign in to comment.