Powered By Blogger Submit Your Site To The Web's Top 50 Search Engines for Free! Online Marketing

Subscribe Now

Wednesday, August 24

Menghitung Diagonal Segitiga Menggunakan C++


Contoh Sederhana C++
#include <conio.h>
#include <iosteam.h>
#include <math.h>

main ()
{
int y,x;
float q;
q=2;
clrscr;
cout <<"\n+++++++++++++++++++++++++++++++++++++++++++++++++";
cout <<"\n+            Praktikum C Dasar                  +";
cout <<"\n+        Diagonal Segitiga Siku - siku          +";
cout <<"\n+++++++++++++++++++++++++++++++++++++++++++++++++";
cout <<"\n";
cout <<"\n";
cout <<"\n";
cout <<"\nTinggi Segitiga  : "; cin >> x;cout <<"cm";
cout <<"\nAlas Segiiga     : "; cin >> y;cout <<"cm"

cout <<"\nDiagonal        : " <<sqrt(pow(x,q)+pow(y,q));

getch();

Menghitung Keliling Persegipanjang Menggunakan C++


Contoh Sederhana C++
#include <conio.h>
#include <iosteam.h>
#include <math.h>

main ()
{
int keliling,y,x;


clrscr;
cout <<"n+++++++++++++++++++++++++++++++++++++++++++++++++";
cout <<"\n+            Praktikum C Dasar                  +";
cout <<"\n+        Menghitung Keliling Segi Empat         +";
cout <<"\n+++++++++++++++++++++++++++++++++++++++++++++++++";
cout <<"\n";
cout <<"\n";
cout <<"\n";
cout <<"Panjang SegiEmpat  : "; cin >> x;
cout <<"Lebar SegiEmpat    : "; cin >> y;
keliling = x+x+y+y;
cout <<"\nKeliling          : " <<keliling;

getch();

Popular Posts This Months

Related Posts Plugin for WordPress, Blogger...

IP