About

Universitas Pamulang

Fakultas Teknik Informatika.

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.

Rabu, 19 Juni 2013

(Mencari Luas, Keliling, dan Diagonal Segi Tiga )



#include<iostream>
#include<math.h>
#include<conio.h>
#include<stdio.h>
using namespace std;
int main(){
            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";
}
}
\
}






pemrograman 1



(Konversi waktu dari detik ke dalam betuk (Jam, Menit, Detik) )

#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(); 
}