Pemrograman Modular C#

namespace TesMethod
{
class Program
{
private static void Masukan()
{
int a;
int b;
int c;
Console.Write(“Nilai A = “);
a=Convert.ToInt32(Console.ReadLine());
Console.Write(“Nilai B = “);
b=Convert.ToInt32(Console.ReadLine());
Console.Write(“Nilai C = “);
c=Convert.ToInt32(Console.ReadLine());
Kurang(a,b,c);//memanggil penjumlahan tanpa menggunakan type data
}
private static void Kurang(int a,int b,int c)
{
int d ;
d = a – b;
Console.WriteLine(“{0} – {1} = {2}”,a,b,d);
Kali(c,d);
}
private static void Kali(int c,int d)
{
int e ;
e = d * c;
Console.WriteLine(“{0} * {1} = {2}”,d,c,e);
}
private static void Hasil()
{
Masukan();
}
public static void Main(string[] args)
{
Hasil();

Console.Write(“Press any key to continue . . . “);
Console.ReadKey(true);
}
}
}

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s