Postingan

Menampilkan postingan dari Januari, 2019

fungsi

#include <iostream> using namespace std; lingkaran(){ float x=3.14; float y,hasil; cout<<"\n\t\t\tMASUKAN NILAI JARI-JARI:"; cin>>y; hasil=x*y*y; cout<<"\n\t\t\tLUAS LINGKARAN ="<<hasil; } persegi_panjang(){ float p,l,hasil; cout<<"\n\t\t\tMASUKAN PANJANG:"; cin>>p; cout<<"\n\t\t\tMASUKAN LEBAR:"; cin>>l; hasil=p*l; cout<<"\n\t\t\tLUAS PERSEGI PANJANG ="<<hasil; } persegi(){ float s,hasil; cout<<"\n\t\t\tMASUKAN SISI PERSEGI:"; cin>>s; hasil=s*s; cout<<"\n\t\t\tLUAS PERSEGI ="<<hasil; } segitiga(){ float a,t,hasil; cout<<"\n\t\t\tMASUKAN ALAS SEGITIGA:"; cin>>a; cout<<"\n\t\t\tMASUKAN TINGGI SEGITIGA:"; cin>>t; hasil=a*t/2; cout<<"\n\t\t\tLUAS SEGITIGA ="<<hasil; } int main(){ int menu; cout<<"\n\t\t\t   PROGRAM MENC...