SlideShare a Scribd company logo
1 of 14
Download to read offline
Politeknik Sawunggalih Aji-Kutoarjo                                                           8/22/2012




                Politeknik Sawunggalih Aji - Kutoarjo




                               Matakuliah : Pemrograman C




                                                        Pertemuan 2




                                                               Dosen : Bambang Sugianto, ST




                        Sistem Penilaian

                           UAS : 40 %
                           UTS : 30 %
                           (QUIS & TUGAS) : 30%




                                                              Dosen : Bambang Sugianto, ST




                                                                                                     1
Politeknik Sawunggalih Aji-Kutoarjo                                                      8/22/2012




                      Sistem Penilaian


                                         Range       Nilai
                                        90 - 100      A
                                        70 - 89       B
                                        50 - 69       C
                                          < 50        D


                                                          Dosen : Bambang Sugianto, ST




                      Forum Diskusi Matakuliah



                         Pemrograman C - POLSA 2011/2012
                          –   Pengumuman kegiatan belajar mengajar
                          –   Diskusi seputar matakuliah




                                                          Dosen : Bambang Sugianto, ST




                                                                                                2
Politeknik Sawunggalih Aji-Kutoarjo                                               8/22/2012




                                      Borland C++ 5.02




                                                   Dosen : Bambang Sugianto, ST




                                                   Dosen : Bambang Sugianto, ST




                                                                                         3
Politeknik Sawunggalih Aji-Kutoarjo                                                                  8/22/2012




                                     Fungsi Manipulator

                                 Menggunakan header iomanip.h

                                         #include <iomanip.h>




                                                                      Dosen : Bambang Sugianto, ST




                                                                 Mengatur jumlah
                                                                 digit desimal
                      setprecision()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>
                      void main()
                      {
                         float a,b,c;
                         a=10;
                         b=3;
                         c=a/b;
                         cout << c << endl;
                         cout << setiosflags(ios::fixed);
                         cout << setprecision(1) << c << endl;
                         cout << setprecision(2) << c << endl;
                         cout << setprecision(3) << c << endl;
                         getch();
                      }
                                                                      Dosen : Bambang Sugianto, ST




                                                                                                            4
Politeknik Sawunggalih Aji-Kutoarjo                                                                   8/22/2012




                                               Mengatur lebar
                                               tampilan
                      setw()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>

                      void main()
                      {
                         cout << "------------------------" << endl;
                         cout << setw(5)<< "a" << endl;
                         cout << setw(6)<< "b" << endl;
                         cout << setw(7)<< "c" << endl;
                         cout << "------------------------" << endl;
                         getch();
                      }




                                                                       Dosen : Bambang Sugianto, ST




                      setw()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>

                      void main()
                      {
                         cout << "------------------------" << endl;
                         cout << setw(5)<< “politeknik" << endl;
                         cout << setw(6)<< “sawunggalih" << endl;
                         cout << setw(7)<< “aji" << endl;
                         cout << "------------------------" << endl;
                         getch();
                      }




                                                                       Dosen : Bambang Sugianto, ST




                                                                                                             5
Politeknik Sawunggalih Aji-Kutoarjo                                                                   8/22/2012




                                                    Menambah karakter
                                                    sejumlah lebar pada
                                                    setw()
                     setfill()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>

                      void main()
                      {
                         cout << "------------------------" << endl;
                         cout << setfill(‘*’);
                         cout << setw(5)<< "a" << endl;
                         cout << setw(6)<< "b" << endl;
                         cout << setw(7)<< "c" << endl;
                         cout << "------------------------" << endl;
                         getch();
                      }



                                                                       Dosen : Bambang Sugianto, ST




                     setfill()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>
                      void main()
                      {
                         cout << "------------------------" << endl;
                         cout << setfill(‘*’);
                         cout << setw(5)<< "a" << endl;
                         cout << setfill(‘#’);
                         cout << setw(6)<< "b" << endl;
                         cout << setfill(‘^’);
                         cout << setw(7)<< "c" << endl;
                         cout << "------------------------" << endl;
                         getch();
                      }

                                                                       Dosen : Bambang Sugianto, ST




                                                                                                             6
Politeknik Sawunggalih Aji-Kutoarjo                                                                 8/22/2012




                                                              Mengatur format
                                                              keluaran data
                      setiosflags()
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>

                      void main()
                      {
                         cout << "Contoh rata kiri :" << endl;
                         cout << setiosflags(ios::left) << setw(10) << "satu";
                         cout << setiosflags(ios::left) << setw(10) << "dua";
                         cout << endl;
                         cout << "Contoh rata kanan :" << endl;
                         cout << setiosflags(ios::right) << setw(10) << "tiga";
                         cout << setiosflags(ios::right) << setw(10) << "empat";
                         getch();
                      }

                                                                     Dosen : Bambang Sugianto, ST




                      setiosflags() untuk perataan

                       ios::left
                        digunakan untuk perataan
                        sebelah kiri
                       ios::right
                        digunakan untuk perataan
                        sebelah kanan

                                                                     Dosen : Bambang Sugianto, ST




                                                                                                           7
Politeknik Sawunggalih Aji-Kutoarjo                                                           8/22/2012




                      setiosflags() untuk konversi notasi
                      keluaran
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>
                      void main()
                      {
                         double x;
                         x=75.45;
                         cout << "hasil ios::scientific = " ;
                         cout << setiosflags(ios::scientific) << x ;
                         cout << endl;
                         cout << "hasil ios::fixed = ";
                         cout << setiosflags(ios::fixed) << x;
                         getch();
                      }
                                                               Dosen : Bambang Sugianto, ST




                      setiosflags() untuk konversi notasi
                      keluaran

                       ios::scientific
                        digunakan untuk mengatur
                        keluaran dalam bentuk
                        eksponensial
                       ios::fixed
                        digunakan untuk mengatur
                        keluaran dalam bentuk desimal
                                                               Dosen : Bambang Sugianto, ST




                                                                                                     8
Politeknik Sawunggalih Aji-Kutoarjo                                                                  8/22/2012




                      setiosflags() untuk menampilkan
                      simbol (+)
                      #include <conio.h>
                      #include <iostream.h>
                      #include <iomanip.h>
                      void main()
                      {
                         int x,y;
                         x=7;
                         y=-8;
                         cout << "Sebelum ios::showpos : ";
                         cout << "x = " << x << " dan y = "<< y ;
                         cout << endl;
                         cout << setiosflags(ios::showpos);
                         cout << "Setelah ios::showpos menjadi : ";
                         cout << "x = " << x << " dan y = "<< y ;
                         getch();
                      }
                                                                      Dosen : Bambang Sugianto, ST




                      setiosflags() untuk menampilkan
                      simbol (+)

                         ios::showpos
                          digunakan untuk menampilkan
                          simbol (+) untuk variabel yang
                          memiliki nilai bilangan positif




                                                                      Dosen : Bambang Sugianto, ST




                                                                                                            9
Politeknik Sawunggalih Aji-Kutoarjo                                                    8/22/2012




                                      Fungsi Matematika

                                Menggunakan header math.h

                                        #include <math.h>




                                                        Dosen : Bambang Sugianto, ST




                      sqrt(x)

                         sqrt(x) memberikan nilai balik berupa akar
                          kuadrat x. Argumen x dan nilai balik bertipe
                          double




                                                        Dosen : Bambang Sugianto, ST




                                                                                             10
Politeknik Sawunggalih Aji-Kutoarjo                                                       8/22/2012




                      sqrt(x)

                      #include <conio.h>
                      #include <iostream.h>
                      #include <math.h>
                      void main()
                      {
                         int x,y;
                         x=81;
                         y=sqrt(x);
                         cout << "Akar kuadrat dari " << x << " adalah " << y;
                         getch();
                      }


                                                           Dosen : Bambang Sugianto, ST




                      Latihan


                                      Dengan a=8 dan b=6 ?




                                                           Dosen : Bambang Sugianto, ST




                                                                                                11
Politeknik Sawunggalih Aji-Kutoarjo                                                             8/22/2012




                      pow(x,y)

                         pow(x,y) memberikan nilai balik berupa xy .
                          Argumen x dan y serta nilai balik bertipe
                          double




                                                                 Dosen : Bambang Sugianto, ST




                      pow(x,y)
                     #include <conio.h>
                     #include <iostream.h>
                     #include <math.h>
                     void main()
                     {
                        double x,y,hasil;
                        x=2;
                        y=3;
                        hasil=pow(x,y);
                        cout << "hasil dari " <<x<< " pangkat " <<y<< " adalah " << hasil;
                        getch();
                     }




                                                                 Dosen : Bambang Sugianto, ST




                                                                                                      12
Politeknik Sawunggalih Aji-Kutoarjo                                                8/22/2012




                      Latihan

                      1.     x3 + y4+5
                             dengan x=5 dan y=3 ?

                      2.          dengan x=27 ?




                                                    Dosen : Bambang Sugianto, ST




                      Fungsi Matematika Lainnya

                          sin(x)
                          cos(x)
                          tan(x)
                          log(x)
                          log10(x)
                          cabs(x)
                      .
                      .
                      .
                      .                             Dosen : Bambang Sugianto, ST

                      .



                                                                                         13
Politeknik Sawunggalih Aji-Kutoarjo                                  8/22/2012




                                      Dosen : Bambang Sugianto, ST




                                                                           14

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Pemrograman c manipulasi string (Bambang Sugianto - Politeknik Sawunggalih Aji - POLSA Kutoarjo)

  • 1. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Politeknik Sawunggalih Aji - Kutoarjo Matakuliah : Pemrograman C Pertemuan 2 Dosen : Bambang Sugianto, ST Sistem Penilaian  UAS : 40 %  UTS : 30 %  (QUIS & TUGAS) : 30% Dosen : Bambang Sugianto, ST 1
  • 2. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Sistem Penilaian Range Nilai 90 - 100 A 70 - 89 B 50 - 69 C < 50 D Dosen : Bambang Sugianto, ST Forum Diskusi Matakuliah  Pemrograman C - POLSA 2011/2012 – Pengumuman kegiatan belajar mengajar – Diskusi seputar matakuliah Dosen : Bambang Sugianto, ST 2
  • 3. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Borland C++ 5.02 Dosen : Bambang Sugianto, ST Dosen : Bambang Sugianto, ST 3
  • 4. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Fungsi Manipulator Menggunakan header iomanip.h #include <iomanip.h> Dosen : Bambang Sugianto, ST Mengatur jumlah digit desimal setprecision() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { float a,b,c; a=10; b=3; c=a/b; cout << c << endl; cout << setiosflags(ios::fixed); cout << setprecision(1) << c << endl; cout << setprecision(2) << c << endl; cout << setprecision(3) << c << endl; getch(); } Dosen : Bambang Sugianto, ST 4
  • 5. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Mengatur lebar tampilan setw() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { cout << "------------------------" << endl; cout << setw(5)<< "a" << endl; cout << setw(6)<< "b" << endl; cout << setw(7)<< "c" << endl; cout << "------------------------" << endl; getch(); } Dosen : Bambang Sugianto, ST setw() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { cout << "------------------------" << endl; cout << setw(5)<< “politeknik" << endl; cout << setw(6)<< “sawunggalih" << endl; cout << setw(7)<< “aji" << endl; cout << "------------------------" << endl; getch(); } Dosen : Bambang Sugianto, ST 5
  • 6. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Menambah karakter sejumlah lebar pada setw() setfill() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { cout << "------------------------" << endl; cout << setfill(‘*’); cout << setw(5)<< "a" << endl; cout << setw(6)<< "b" << endl; cout << setw(7)<< "c" << endl; cout << "------------------------" << endl; getch(); } Dosen : Bambang Sugianto, ST setfill() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { cout << "------------------------" << endl; cout << setfill(‘*’); cout << setw(5)<< "a" << endl; cout << setfill(‘#’); cout << setw(6)<< "b" << endl; cout << setfill(‘^’); cout << setw(7)<< "c" << endl; cout << "------------------------" << endl; getch(); } Dosen : Bambang Sugianto, ST 6
  • 7. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Mengatur format keluaran data setiosflags() #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { cout << "Contoh rata kiri :" << endl; cout << setiosflags(ios::left) << setw(10) << "satu"; cout << setiosflags(ios::left) << setw(10) << "dua"; cout << endl; cout << "Contoh rata kanan :" << endl; cout << setiosflags(ios::right) << setw(10) << "tiga"; cout << setiosflags(ios::right) << setw(10) << "empat"; getch(); } Dosen : Bambang Sugianto, ST setiosflags() untuk perataan  ios::left digunakan untuk perataan sebelah kiri  ios::right digunakan untuk perataan sebelah kanan Dosen : Bambang Sugianto, ST 7
  • 8. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 setiosflags() untuk konversi notasi keluaran #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { double x; x=75.45; cout << "hasil ios::scientific = " ; cout << setiosflags(ios::scientific) << x ; cout << endl; cout << "hasil ios::fixed = "; cout << setiosflags(ios::fixed) << x; getch(); } Dosen : Bambang Sugianto, ST setiosflags() untuk konversi notasi keluaran  ios::scientific digunakan untuk mengatur keluaran dalam bentuk eksponensial  ios::fixed digunakan untuk mengatur keluaran dalam bentuk desimal Dosen : Bambang Sugianto, ST 8
  • 9. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 setiosflags() untuk menampilkan simbol (+) #include <conio.h> #include <iostream.h> #include <iomanip.h> void main() { int x,y; x=7; y=-8; cout << "Sebelum ios::showpos : "; cout << "x = " << x << " dan y = "<< y ; cout << endl; cout << setiosflags(ios::showpos); cout << "Setelah ios::showpos menjadi : "; cout << "x = " << x << " dan y = "<< y ; getch(); } Dosen : Bambang Sugianto, ST setiosflags() untuk menampilkan simbol (+)  ios::showpos digunakan untuk menampilkan simbol (+) untuk variabel yang memiliki nilai bilangan positif Dosen : Bambang Sugianto, ST 9
  • 10. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Fungsi Matematika Menggunakan header math.h #include <math.h> Dosen : Bambang Sugianto, ST sqrt(x)  sqrt(x) memberikan nilai balik berupa akar kuadrat x. Argumen x dan nilai balik bertipe double Dosen : Bambang Sugianto, ST 10
  • 11. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 sqrt(x) #include <conio.h> #include <iostream.h> #include <math.h> void main() { int x,y; x=81; y=sqrt(x); cout << "Akar kuadrat dari " << x << " adalah " << y; getch(); } Dosen : Bambang Sugianto, ST Latihan Dengan a=8 dan b=6 ? Dosen : Bambang Sugianto, ST 11
  • 12. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 pow(x,y)  pow(x,y) memberikan nilai balik berupa xy . Argumen x dan y serta nilai balik bertipe double Dosen : Bambang Sugianto, ST pow(x,y) #include <conio.h> #include <iostream.h> #include <math.h> void main() { double x,y,hasil; x=2; y=3; hasil=pow(x,y); cout << "hasil dari " <<x<< " pangkat " <<y<< " adalah " << hasil; getch(); } Dosen : Bambang Sugianto, ST 12
  • 13. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Latihan 1. x3 + y4+5 dengan x=5 dan y=3 ? 2. dengan x=27 ? Dosen : Bambang Sugianto, ST Fungsi Matematika Lainnya  sin(x)  cos(x)  tan(x)  log(x)  log10(x)  cabs(x) . . . . Dosen : Bambang Sugianto, ST . 13
  • 14. Politeknik Sawunggalih Aji-Kutoarjo 8/22/2012 Dosen : Bambang Sugianto, ST 14