This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Thursday, June 27, 2013

Menghitung Persegi Panjang dengan C++

post pertama ane nih gan, coding untuk mencari luas, keliling dan diagonal persegi panjang dulu aje ya gan, oke oke,,ehehe
dengan software C++ pastinya..

coding :

#include<iostream>
#include<math.h>
#include<conio.h>
#include<stdio.h>
using namespace std;
int main(){
char ulang;
do {
int pilih;
double panjang,lebar,luas,keliling,diagonal;
//clrscr();
panjang=9;
lebar=5;
cout<<"menu empat persegi panjang" <<endl;
cout<<"----------------------------------" <<endl;
cout<<"1. Hitung Luas" <<endl;
cout<<"2. Hitung Keliling" <<endl;
cout<<"3. Hitung Diagonal" <<endl;
cout<<"4. Keluar" <<endl;
cout<<"----------------------------------" <<endl;
cout<<"Masukan Pilihan[1,2,3,4] :";cin>>pilih;
cout<<"Masukan Panjang : "; cin>>panjang;
cout<<"Masukan Lebar : " ;cin>>lebar ;
cout<<endl;
switch(pilih)
{
case 1 :{
luas=panjang*lebar;
cout<<"Luas Persegi panjang = " <<luas <<endl;
break;
}
case 2 :{
keliling=(2 * panjang) + (2 * lebar);
cout<<"Keliling dari persegi panjang adalah = " <<keliling <<endl;
break;
}
case 3 :{
diagonal=sqrt((double) panjang * panjang + (double) lebar*lebar);
cout<<"diagonal dari persegi panjang = " <<diagonal <<endl;
break;
}
case 4 : {
cout<<"Terima kasih telah menggunakan program ini";
}
}
cout<<"mencoba lagi [y/t] ? ";cin>>ulang;
}while ((ulang=='y') || (ulang=='Y'));
\
 system ("Pause");
}


 hasilnya ni gan cakep kan ,, cewek kali cakep..ehehe

Konversi waktu dari detik ke jam, menit, detik





Ini sobat ane kasih tau bagaimana mengkonversi waktu dari detik ke jam menit dan detik dengan menggunakan software C++..
ini codingnya gan selamat menikmati......eheheh

coding :


#include<stdio.h> 
#include<conio.h> 
int main() 
{ 
long int a,b,c,d,e; 
printf("------------------------\n"); 
printf("Program konversi waktu\n"); 
printf("------------------------\n"); 
printf("Input waktu(Detik) = ");scanf("%ld",&c); 
a=c/3600; 
d=c%3600; 
b=d/60; 
e=d%60; 
printf("%ld",a);printf(" jam "); 
printf("%ld",b);printf(" Menit "); 
printf("%ld",e);printf(" Detik "); 
getch(); 
}