if else c#
Rabu, 20 Oktober 2021
Edit
using System;
namespace ifelsecsharp
{
class Program
{
static void Main(string[] args)
{
Console.Write("masukkan umur: ");
string inputUmur = Console.ReadLine();
int iUmur = int.Parse(inputUmur);
string s;
if (iUmur >= 17) {
s = "Dewasa";
}else{
s = "Anak‐anak";
}
Console.WriteLine(s);
Console.ReadKey();
}
}
}