Tips for heathy life

Tips for heathy life

Minggu, 02 November 2008

How make program that calculates flat wake in C++?

I want to share program that calculate flat wake in C++. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article.

--------
#include
#include

void main ( )
{
const float phi=3.14;
float r,a,t,kell,luas;
int kode;
char pilih;

awal :
cout<<"||======================================||"<<<"||Program menghitung rumus bangun datar ||"<<<"||======================================||"<<<"\n 1. Keliling Lingkaran "<<<"2. Luas Segitiga "<<<"\n Pilihan anda adalah (1..2) = "; cin>>kode;
switch (kode)
{
case 1 :
cout<<"Anda memilih nomor 1 yaitu menghitung keliling lingkaran"; cout<<"\nMasukkan jari-jari = "; cin>>r;
kell=2*phi*r;
cout<<"\nKeliling Lingkaran = "<<<<"Anda memilih nomor 2 yaitu menghitung luas segitiga"; cout<<"\nMasukkan alas = "; cin>>a;
cout<<\nMasukkan tinggi = "; cin>>t;
luas=a*t*0.5;
cout<<"\nLuas Segitiga = "<<<<"\nMaaf anda memasukkan kode yang salah"<<<"Ingin mengulang lagi [Y/T] = "; cin>>pilih;
if ((pilih=='Y'||(pilih=='y'))
{
goto awal;
}
clrscr ( );
cout<<"\nGoodbye!!!";
}
goto awal;
getch ( );
}

0 komentar:

Posting Komentar