1 / 6

TUGAS PEMROGRAMAN TERSTRUKTUR

TUGAS PEMROGRAMAN TERSTRUKTUR. Dibuat oleh: 1.Wiwin Oktaviani 2.Rikki Affandi 3.Dedi Kurniawan. Hitung Sin, Cos dan Tangen. #include <iostream.h> #include <conio.h> #include <math.h> void hitung_sinus (float a) { float sinus; sinus=sin(a);

johnna
Télécharger la présentation

TUGAS PEMROGRAMAN TERSTRUKTUR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TUGAS PEMROGRAMAN TERSTRUKTUR Dibuat oleh: 1.Wiwin Oktaviani 2.Rikki Affandi 3.Dedi Kurniawan

  2. Hitung Sin, Cos dan Tangen • #include <iostream.h> • #include <conio.h> • #include <math.h> • void hitung_sinus (float a) • { • float sinus; • sinus=sin(a); • cout<<"\nSinus dari angka" << ' '<< a; cout <<' '<<"adalah :"<<sinus<<"\n"; • cout <<"Tekan Esc untuk keluar program"<<endl; • return ; • }

  3. void hitung_cosinus(float a) • { • float cosinus; • cosinus=cos(a); • cout<<"\nCosinus dari angka" << ' '<< a; cout <<' '<<"adalah :"<<cosinus<<"\n"; • cout <<"Tekan Esc untuk keluar program"<<endl; • return ; • } • void hitung_tangen (float a) • { • float tangen; • tangen=tan(a); • cout<<"\nTangen dari angka" << ' '<< a; cout <<' '<<"adalah :"<<tangen<<"\n"; • cout <<"Tekan Esc untuk keluar program"<<endl; • return ; • }

  4. main() { float a, x; char kar; cout<<"Hitung Sinus, Cosinus dan Tangen" <<endl; cout<<"Masukkan angkanya:";cin>>a;

  5. cout<<"\nApa yang ingin anda cari? (1.Sinus 2.Cosinus 3.Tangen): "; cin>>x;endl; if(x==1) hitung_sinus(a); else if (x==2) hitung_cosinus(a); else if (x==3) hitung_tangen(a); else cout <<"\nTak ada dalam daftar, tekan Esc untuk keluar program"<<endl

  6. for ( ; ;) • { • kar = getche(); • if (kar == 27) • break; • } • }

More Related