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.

Saturday, March 5, 2011

OPERATOR


using System;

namespace aku
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int x,y,z;
Console.WriteLine("\t\t\t\tOPERATOR\n");
Console.Write("\t\tbilangan pertama : ");
x=Convert.ToInt32(Console.ReadLine());
Console.Write("\t\tbilangan kedua : ");
y=Convert.ToInt32(Console.ReadLine());
z=x+y;
Console.WriteLine("\t\tHasil penjumlahan adalah : {0}",z);
Console.ReadLine();

}
}
}

IF


using System;

namespace ConsoleApplication1
{
class coba
{
[STAThread]
static void Main(string[] args)
{
int a,b;
Console.WriteLine("\t\t\t\tif");
Console.WriteLine("\t\t==============================");
Console.Write("Masukkan bilangan pertama : ");
a = Convert.ToInt32(Console.ReadLine());
Console.Write("Masukkan bilangan kedua   : ");
b = Convert.ToInt32(Console.ReadLine());
if(a>b)//if syarat
{
Console.WriteLine("\nBilangan terbesar adalah : {0}",a);
Console.ReadLine();
}
if(a<b)//if syarat
{
Console.WriteLine("\nBilangan terbesar adalah : {0}",b);
Console.ReadLine();
}

}
}
}

LOOP


using System;

namespace loop
{
class loop
{
[STAThread]
static void Main(string[] args)
{
int a,b,i;
string c,d,z;
Console.WriteLine("\t\t\t\t    LOOP");
Console.WriteLine("\t\t\t\t==============\n\n");
Console.WriteLine("\t\t\t\tData Mahasiswa");
Console.WriteLine("\t\t\t\t==============");
Console.Write("\tMasukkan jumlah Mahasiswa yg akan di input datanya : ");
a=Convert.ToInt32(Console.ReadLine());
do//pengulangan apabila while memenuhi syarat
{
for (i=1;i<=a;i++)//loop pake for
{
Console.WriteLine("\n");
Console.WriteLine("\t\t\tData Mahasiswa ke {0}",i);
for(b=1;b<=i;b++);
{
Console.Write("\t\t\tNama Mahasiswa : ");
c=Console.ReadLine();
Console.WriteLine("\t\t\tNama Mahasiswa adalah {0}",c);
Console.Write("\t\t\tTtl : ");
d=Console.ReadLine();
Console.WriteLine("\t\t\tTanggal Lahirnya {0}",d);

}
}
Console.WriteLine("\t\t\tApakah Anda ingin mengulang ?");
z=Console.ReadLine();
}
while (z=="y"||z=="Y");
Console.WriteLine("\t\t\tThank u for using this program");
Console.ReadLine();
}
}
}