Robekan Kampus@unpam
riwayat ngampus
About
Rumah
Business
Internet
Market
Stock
Downloads
Dvd
Games
Software
Office
Full Campus
The First Course
Pemrograman 1
Logika Informatika
Kalkulus 1
Kecakapan Antar Personal
Fisika Dasar 1
Second Course
Shird Course
Fourth Couse
Featured
Downloads
Games
Software
Iseng-iseng
Hacker
Tutorial
Do'aku
C++ Persegi panjang
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
#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");
}
0 komentar:
Posting Komentar
Beranda
Langganan:
Postingan (Atom)
Social Profiles
Popular
Tags
Blog Archives
Diberdayakan oleh
Blogger
.
Mengenai Saya
Unknown
Lihat profil lengkapku
Arsip Blog
▼
2013
(2)
▼
Juni
(2)
(Mencari Luas, Keliling, dan Diagonal Segi Tiga )
pemrograman 1
Arsip Blog
▼
2013
(2)
▼
Juni
(2)
(Mencari Luas, Keliling, dan Diagonal Segi Tiga )
pemrograman 1
Blogger templates
0 komentar:
Posting Komentar