Pages

Subscribe:

Selamat Datang

Terima Kasih telah Mengunjungi Blog saya

Minggu, 25 Januari 2015

NIM & Nama

CSharp :

 
# Main Program

using System;

namespace Csharp
{
 class Program
 {
  public static void Main(string[] args)
  {
   biodata b = new biodata();
   b.nim = "1113101088";
   b.nama = "Aris Sugiarto";
   b.tampilkan();
   
   Console.ReadKey(true);
  }
 }
}

# Method

using System;

namespace Csharp
{
 
 public class biodata
 {
  public string nim;
  public string nama;
  
  public void tampilkan()
  {
   Console.WriteLine("Nim : "+nim);
   Console.WriteLine("Nama : "+nama);
  }
 }
}


C++ :


#include 
#include 
using namespace std;
class biodata
{
public :
    string nim;
    string nama;
    void tampilan(){
        cout << "Nim    :"+nim << endl;
        cout << "Nama   :"+nama << endl;
    }
};

int main()
{
    biodata c;
    c.nim = "1113101088";
    c.nama = "Aris Sugiarto";
    c.tampilan();
    cin.get();
    return 0;
}


Java :


# Main Program

package jav;

public class biodata 
{
    public String nim;
    public String nama;
    
    public void tampilkan()
    {
        System.out.println("Nim : "+nim);
        System.out.println("Nama : "+nama);
    }
}

# Method

package jav;

public class Jav
{

    public static void main(String[] args) 
    {
       biodata b = new biodata ();
       b.nim = "1113101088";
       b.nama = "Aris Sugiarto";
       b.tampilkan();
    }
}


Terima kasih..
Semoga bermanfaat

0 komentar:

Posting Komentar