Jumat, 30 Oktober 2015

koding kakulator sederhana pakai bahasa c++

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
   
    int a,b,c,d,e,f,phi,g,r;
    phi=3,14;
   
    cout<<endl;
    cout<<"      SELAMAT DATANG     "<<endl;
    cout<<"========================="<<endl;
    cout<<"| NAMA  | LAZUARDI.I.A  |" <<endl;
    cout<<"-------------------------"<<endl;
    cout<<"| NIM   |  1500018010   |"<<endl;
    cout<<"| PRODI | T.INFORMATIKA |" <<endl;
    cout<<"| UNIV  |   UAD 2015    |" <<endl;
    cout<<"========================="<<endl;
    cout<<endl;
    cout<<"==================================================="<<endl;
    cout<<"| TUGAS... Membuat Kakulator Sederhana            |"<<endl;
    cout<<"==================================================="<<endl;
    cout<<endl;
    cout<<"masukkan nilai : ";
    cin>>a;
    cout<<"masukkan nilai : ";
    cin>>b;
    cout<<"masukkan nilai r : ";
    cin>>r;
    cout<<endl;
    c=a+b;
    d=a*b;
    e=a/b;
    f=a-b;
    g=phi*r^2;
    
    cout<<"=========="<<endl;
    cout<<"| JAWABAN |"<<endl;
       cout<<"-----------"<<endl;
       cout<<endl;
    cout<<"hasil (+)    \t = "<<c<<endl ;
    cout<<"hasil (*)    \t = "<<d<<endl;
    cout<<"hasil (/)    \t = "<<e<<endl;
    cout<<"hasil (-)    \t = "<<f<<endl;
    cout<<"hasil luas lingkaran \t = "<<g<<endl;
    cout<<endl;
    cout<<endl;
    cout<<"======================="<<endl;
    cout<<"|    TERIMA KASIH     |"<<endl;
    cout<<"|          :*         |"<<endl;
    cout<<"======================="<<endl;
  
   
    return 0;
}

Tidak ada komentar:

Posting Komentar