Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Kelompok 2.4

154 views

Published on

Tugas Kelompok Alpro 2.4
Bikin program factorial persyaratannya dimana n kurang dari 0 harus 1 2 dst.

Published in: Education
  • Be the first to comment

  • Be the first to like this

Kelompok 2.4

  1. 1. 2.4Bikin program factorial persyaratannya dimana n kurang dari 0 harus 1 2 dst Analisis: Input : N (integer) Proses : factorial  1 i1 factorialfactorial*I ii+1 Output : "Nilai factorialnya adalah” +factorial
  2. 2. Algoritma Aljabar Deklarasi: N : integer (input) i : integer (inisialisasi) factorial : integer (output) Deskripsi: read(N,i,factorial) factorial  1 i1 factorialfactorial*I ii+1 write("Nilai factorialnya adalah "+factorial)
  3. 3. BAHASA C++ #include <iostream> #include <string> using namespace std; int main() { string raptor_prompt_variable_zzyz; int n; int i; int factorial; raptor_prompt_variable_zzyz ="Masukan nilai "; cout << raptor_prompt_variable_zzyz << endl; cin >> n; factorial =1; i =1; while (!(i>n)) { factorial =factorial*i; i =i+1; } cout << "Nilai factorialnya adalah "<<factorial << endl; return 0; }

×