Archive for the 'The Art of Code' Category

Pembayaran Utang

Jawaban ALPRO MODUL 5 Studi Kasus nomor 3 (bisa di run di Dev C++)

#include <stdio.h>

#include <conio.h>

int main()

{

    float U,B,C;

    int I;

    U = 100000;

    I = 1;

    while(I<=10)

    {

        B = U * 0.02;

        U = U + B;

        C = 0.1 * U;

        printf(“\nCicilan bulan %d : %10.2f”,I,C);

        I++;

    }       

    printf(“\n\nSisa Utang : %10.2f”,U); 

    getch();

    return 0;

}

Segitiga Pascal

Jawaban ALPRO MODUL 5 Studi Kasus nomor 2 (bisa di run di DEV C++)

#include <stdio.h>

#include <stdio.h>

#include <conio.h>

#include <stdlib.h>

int main()

{

   int I,J,K,N,spc;

   float Atas,B,B1,B2,Nil;

   do{

   system(“CLS”);

   printf(“Masukkan banyak baris segitiga Pascal Anda : “);scanf(“%d”,&N);

   for(K=0;K<=N;K++)

   {

       //Hitung Atas = N!

       printf(“\n”);

       for(spc=0;spc<=N-K;spc++)

       {

           printf(”  ”);

       }

       Atas = 1;

       for(I=1;I<=K;I++)

       {

           Atas = Atas * I;

       }

       //Cetak Koefisien Binomial

Continue reading ‘Segitiga Pascal’

Decimal to Biner Converter (max 255)

Jawaban ALPRO MODUL 5 STUDI KASUS nomor 1 (bisa di run di Dev C++)

#include <stdio.h>

#include <conio.h>

#include <stdlib.h>

int main()

{

    int K,N,I,X,A;

    do{

    do{

    system(“CLS”);

    printf(“Masukkan suatu bilangan desimal (MAX 255) : “);scanf(“%d”,&N);

    }while(N<0 || N>255);    

    printf(“Hasil Konversi ke BINER “);

    X=128;

    for(I=1;I<=8;I++)

    {

        if(N>=X)

        {

         N=N-X;

         A=1;            

        }

        else A=0;

        printf(“%3d”,A);

        X=X/2;    

    }  

    getch();

    }while(N>=0);    

    return 0;  

}

The Beginning of Code

#include <stdio.h>
#inlcude <conio.h>

void main()

{

printf(” FOR all of you “);

printf(” Aku coba share pengetahuanku akan coding yang terbatas ini untuk semua praktikanku!”);

getch();

}



Follow

Get every new post delivered to your Inbox.