Input pada C#

Input C#

  • Script

using System;

class ProgramInput
{
    static void Main(String[] args)
    {
        Console.WriteLine("#PROGRAM INPUT#");

        Console.Write("Nama: ");
        string nama = Console.ReadLine();

        Console.WriteLine("Hi, {0}. Sehat selalu!", nama);
        Console.Write("Kelas: ");
        string Kelas = Console.ReadLine();
        
        int noabsen;
        Console.Write("No. absen: ");
        noabsen = int.Parse(Console.ReadLine());

        Console.Write("Hobi: ");
        string hobi = Console.ReadLine();
        
        Console.Write("Tanggal lahir: ");
        string Tanggallahir = Console.ReadLine();

        int umur;
        Console.Write("Umur: ");
        umur = int.Parse(Console.ReadLine());

        Console.Write("Alamat: ");
        string alamat = Console.ReadLine();

        Console.Write("Username IG: ");
        string ig = Console.ReadLine();

    }
}

  • Input


Comments