This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Selasa, 16 April 2013

Program Penjumlahan & Pengurangan Matriks C++

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

int main(void )
{
    typedef int matriks[100][100];
    matriks A,B;
    int b, k, pil;
    int  baris, kolom;
    char ulang='Y';

    do{
        system("cls");
        printf("============================\n");
        printf("|       MENU PROGRAM       |\n");
        printf("============================\n");
        printf(" 1. Penjumlahan Matriks \n");
        printf(" 2. Pengurangan Matriks \n");
        //printf(" 3. Perkalian Matriks \n");
        printf("============================\n");
        printf(" Pilih [ 1 | 2 ] : ");scanf("%d",&pil);

        //system("cls");
        printf("\nElemen Matriks A : \n");
        printf("===================\n");
        printf("Jumlah Baris : ");scanf("%d",&baris);
        printf("Jumlah kolom : ");scanf("%d",&kolom);
        printf("-------------------\n");
        for(b=0; b<baris; b++)
        {
            for (k=0; k<kolom; k++)
            {
                printf("A[%d][%d]= ",b,k);scanf("%d", &A[b][k]);
            }
        }

        printf("\nElemen Matriks B : \n");
        printf("===================\n");
        printf("Jumlah Baris : ");scanf("%d",&baris);
        printf("Jumlah Kolom : ");scanf("%d",&kolom);
        printf("-------------------\n");
        for(b=0; b<baris; b++)
        {
            for (k=0; k<kolom; k++)
            {
                printf("B[%d][%d]= ",b,k);scanf("%d", &B[b][k]);
            }
        }

        system("cls");
        printf("Isi Matrik A : \n");
        printf("==================\n");
        for(b=0; b<baris; b=b+1)
        {
            for(k=0; k<kolom; k=k+1)
            {
                printf("    %d   ", A[b][k]);
            }
            printf("\n");
        }

        printf("\nIsi Matrik B : \n");
        printf("==================\n");
        for(b=0; b<baris; b=b+1)
        {
            for(k=0; k<kolom; k=k+1)
            {
                printf("    %d   ", B[b][k]);
            }
            printf("\n");
        }

        switch(pil)
        {
                case 1 :
                {
                    printf("\nHasil Penjumlahan \n");
                    printf("==================\n");
                    for(b=0; b<baris; b=b+1)
                    {
                        for(k=0; k<kolom; k=k+1)
                        {
                            printf("    %d   ", A[b][k]+ B[b][k]);
                        }
                        printf("\n");
                    }
                }break;
                case 2 :
                {
                    printf("\nHasil Pengurangan \n");
                    printf("==================\n");
                    for(b=0; b<baris; b=b+1)
                    {
                        for(k=0; k<kolom; k=k+1)
                        {
                            printf("    %d   ", A[b][k]-B[b][k]);
                        }
                        printf("\n");
                    }
                }break;
            default :
            {
                //printf("\n*\n");
                pil=0;printf("\n* Input Pilih Salah !!! \n");
                printf("=====================\n");
            }

        }
        printf("\n");
        //printf("\n");
        printf("** Ingin mengulang dari awal? [ Y / T ] : ");scanf("%s", &ulang);
    }
    while((ulang=='y' )|| (ulang=='Y'));

     system("cls");
     printf("=========================================================================\n");
     printf("========================* T E R I M A  K A S I H *=======================\n");
    getch();
}

Hasil Setelah di run..
a.Input










b.Output






Program Penjualan DVD dengan C++

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<windows.h>
int x;
struct
{  char judul[30][20];
    char jenis[10][20];
    char kode;
    int inputan;
    float jumlah[5];
    float harga[5];
}DVD;
void input ()
{
    printf("========================================================\n");
    printf("                    PROGRAM PENJUALAN DVD \n");
    printf("                       * AGYL CINEMA * \n");
    printf("=======================================================\n\n");
    printf("Berapa jumlah inputan : ");scanf("%d",&DVD.inputan);printf("\n");
    for(x=1; x<=DVD.inputan; x++)
    {
    printf("Masukan data DVD ke-%d \n",x);fflush(stdin);
    printf("Masukkan Judul DVD                       : ");scanf("%[^\n]",&DVD.judul[x]);fflush(stdin);
    printf("Masukkan Jenis DVD [ MP3 | FILM | GAME ] : ");scanf("%[^\n]",&DVD.jenis[x]);fflush(stdin);
    printf("Masukkan Jumlah Beli                     : ");scanf("%f",&DVD.jumlah[x]);
    printf("Masukkan Harga                           : ");scanf("%f",&DVD.harga[x]);fflush(stdin);printf("\n");
    }
}
void output ()
{
    system ("cls");
    printf("====================================\n");
    printf("        STRUK PEMBAYARAN DVD \n");
    printf("          * AGYL CINEMA * \n");
    printf("====================================\n");
    for(x=1; x<=DVD.inputan; x++)
    {
    printf("\ndata DVD ke-%d ",x);
    printf("\nJudul DVD     : %s",DVD.judul[x]);
    printf("\nJenis DVD     : %s",DVD.jenis[x]);
    printf("\nJumlah Beli   : %1.f",DVD.jumlah[x]);
    printf("\nHarga         : Rp.%8.2f",DVD.harga[x]);
    printf("\nBayar         : Rp.%8.2f",DVD.jumlah[x]*DVD.harga[x]);
    printf("\n\n");
    }
    printf("====================================\n");
    printf("=========== TERIMA KASIH ===========\n");
}

main()
{
    input();
    output();

}

Hasil
a. Input










b.Output