10 Principles that Brought me MILLIONS (It can work for you too)

10 Principles that Brought me MILLIONS (It can work for you too)

TI buatlah contoh coding program bahasa c (else if dan for if) deret angka!!​

buatlah contoh coding program bahasa c (else if dan for if) deret angka!!​

Jawaban:

#include <stdio.h>

unsigned int deret2(int n)

{

 if (n == 1)

   return 1;

 else

   return (deret2(n-1) * 2);

}

int main()

{

 int x;

 for (x=1; x<=10; x++)

   printf("%5d", deret2(x));

 return 0;

}