menu bar

Saturday, 9 April 2016

Menghitung keliling segitiga




#include <iostream>
#include <math.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
float kel_seg(int l,int t){
float m=sqrt(t*t+(l*l/4));
return (2*m+t);
}

int main(int argc, char** argv) {
int l,t;
cout<<"masukkan lebar= ";cin>>l;
cout<<"masukkan tinggi= ";cin>>t;
cout<<"kelling segitiga = "<<kel_seg(l,t);
return 0;
}

No comments:

Post a Comment