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.

Friday, June 17, 2011

IPA 1

temanku.....

Sunday, March 6, 2011

SELISIH WAKTU


using System;

namespace Selisilh_waktu_0320100017
{
class Class1
{
public struct jam
{
public int hh;
public int mm;
public int ss;
}
static void Main(string[] args)
{
jam w1;
jam w2;
jam w3;
Console.Write("Jam awal percakapan : ");
w1.hh = Convert.ToInt32(Console.ReadLine());
Console.Write("Menit awal percakapan : ");
w1.mm = Convert.ToInt32(Console.ReadLine());
Console.Write("Detik awal percakapan : ");
w1.ss = Convert.ToInt32(Console.ReadLine());
Console.Write("Jam akhir percakapan : ");
w2.hh = Convert.ToInt32(Console.ReadLine());
Console.Write("Menit akhir percakapan : ");
w2.mm = Convert.ToInt32(Console.ReadLine());
Console.Write("Detik awal percakapan : ");
w2.ss = Convert.ToInt32(Console.ReadLine());
w3.mm = 0;
w3.ss = 0;
if(w2.ss>=w1.ss)
{
w3.ss=w2.ss-w1.ss;
if(w2.mm>=w1.mm)
{
w3.mm=w2.mm-w1.mm;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
if(w2.mm<w1.mm)
{
w3.mm=(w2.mm+60)-w1.mm;
w2.hh=w2.hh-1;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}

}
if(w2.ss<w1.ss)
{
w3.ss=(w2.ss+60)-w1.ss;
w2.mm=w2.mm-1;
if(w2.mm>=w1.mm)
{
w3.mm=w2.mm-w1.mm;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
if(w2.mm<w1.mm)
{
w3.mm=(w2.mm+60)-w1.mm;
w2.hh=w2.hh-1;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
}
Console.ReadLine();
}
}
}

FAKTORIAL


using System;

namespace Faktorial_017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int n, fak, k,i,l;
Console.Write("Masukkan Bilangan : ");
n=Convert.ToInt32(Console.ReadLine());
if(n==0)
{
Console.WriteLine("Faktorial : 1");
Console.ReadLine();
}
else
{
fak=1;
for(i=n;i>=1;i--)
{
l=fak*i;
fak=l;
}
Console.WriteLine("Nilai faktorial adalah : {0}",fak);
Console.ReadLine();
}
}
}
}