[NITIP] Tugas Pertemuan 4 No. 2
CODING
#include <iostream.h>#include <conio.h>
main(){
const float phi = 3.14;
float r;
float Keliling;
char pil;
input:
cout<<"-------------------------------------"<<endl;
cout<<"Program Menghitung Keliling Lingkaran"<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Input Jari - Jari : "; cin>>r;
Keliling = 2 * phi * r;
cout<<endl<<"Jadi Keliling Lingkaran Adalah "<<Keliling<<endl;
cout<<"-------------------------------"<<endl;
cout<<"Ingin Mengitung Kembali ? [Y/N]"; cin>>pil;
if(pil == 'Y' || pil == 'y'){
clrscr();
goto input;
} else {
clrscr();
cout<<"Baik !! Selamat Tinggal :) "<<endl;
}
getch();
}
Post a Comment: