Tuesday, 17 April 2012

C + + program to display build

#include <iostream>
#include <string>

using namespace std;

int main()
{
   string raptor_prompt_variable_zzyz;
   int k;
   int p;
   int l;
   raptor_prompt_variable_zzyz ="masukan panjang";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> p;
   raptor_prompt_variable_zzyz ="masukan lebar";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> l;
   if (p==l)
   {
      cout << "persegi" << endl; l =p*l;
      k =p+p+l+l;
      cout << "LUAS PERSEGI ="+l << endl; cout << "KELILING PERSEGI ="+k << endl; }
   else
{
      cout << "persegi_panjang" << endl; l =p*l;
      k =2*(p+l);
      cout << "LUAS PERSEGI PANJANG ="+l << endl; cout << "KELILING PERSEGI PANJANG         ="+k << endl; }

system("PAUSE");
   return EXIT_SUCCESS;
}

0 comments:

Post a Comment

.

.

.

.
Design by BlogSpotDesign | Ngetik Dot Com