Struktur Data – Contoh Program Recursive II


Screenshot:
recursive 2

Script:
#include <stdio.h>
#include <conio.h>

int main(){
int nilai,a,i,j,k;
printf(“Masukkan nilai: “);
scanf(“%i”, &nilai);
for (i=0; i<=nilai-1; i++){
for (k=0; k<=((2*nilai)-(2*i)); k++){
printf(” “);
}
for (j=0; j<=i; j++){
if (j==0||i==j){
a=1;
}
else{
a=a*(i+1-j)/j;
}
printf(“%5i”, a);
}
printf(“\n”);
}
getch();
}

One Comment Add yours

  1. certainly like your web site but you need to take a look at the spelling on several of your
    posts. Many of them are rife with spelling problems and I find it very troublesome
    to inform the truth however I’ll surely come again again.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s