This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Sunday, March 6, 2011

BILANGAN TERBESAR


using System;

namespace Perbandingan_Angka_017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int a,b,c;
Console.Write("A=? ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("B=? ");
b=Convert.ToInt32(Console.ReadLine());
Console.Write("C=? ");
c=Convert.ToInt32(Console.ReadLine());
if(a>b)
{
if(a>c)
{
Console.WriteLine("Bilangan terbesar adalah {0}",a);
}
}
if(c>b)
{
if(c>a)
{
Console.WriteLine("Bilangan terbesar adalah {0}",c);
}
}
if(b>a)
{
if(b>c)
{
Console.WriteLine("Bilangan terbesar adalah {0}",b);
}
}
if(a==b && a==c)
{
Console.WriteLine("Semua bilangan sama besar");
}
if(a==b && a>c)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",a);
}
if(b==c && b>a)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",b);
}
if(a==c && a>b)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",a);
}
Console.ReadLine();


}
}
}

KALKULATOR


using System;

namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
double a,b,d;
string c;
try
{
Console.Write("Angka 1 : ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("+, -,* ,/ : ");
c=Convert.ToString(Console.ReadLine());
Console.Write("Angka 2 : ");
b=Convert.ToInt32(Console.ReadLine());
switch(c)
{
case "+" : d=a+b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "-" : d=a-b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "*" : d=a*b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "/" : d=a/b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
default  :Console.WriteLine("Tanda yang anda masukkan salah");
break;
}
}
catch
{
Console.WriteLine("Maaf Inputan Anda salah, silahkan coba lagi");
Console.ReadLine();
}
}
}
}

Saturday, March 5, 2011

HELLO WORLD


using System;

namespace hello_world_0320100017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Hello world");//tampilan
Console.ReadLine();
}
}
}