C++ Program Penghitung Faktorial - Digital Solutions by Leafcoder

C++ Program Penghitung Faktorial




Kali ini Program Penghitung Faktorial ...

Let's get the code !








  #include 
  
  using namespace std;
  
  double fact(double n);
  
  int main()
  {
      int n;
      cout << "###################################n";
      cout << "###          STT-PLN 2011       ###n";
      cout << "###        Faktorial Solver     ###n";
      cout << "###      Danang Adhi Prasetya   ###n";
      cout << "###################################n";
  
      cout << " Masukkan angka: ";
      cin >> n;
      cout << "n";
      cout << n << "!=";
      cout << fact(n) << endl;
      return 0;
  }
  
  double fact(double n)
  {
      if (n>1) return n*fact(n-1);
      else return 1;
  }

Posting Komentar

0 Komentar




Contact us

Jasa SEO Leafcoder
Support Leafcoder.org
Hi there! We accept any donation via PayPal, hope the articles we provide can always be helpful.