Selasa, 08 Januari 2013

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

void main()
{ //begin
   int S[2][2];

   for (int i=1;i<=2;i++)
   {
    for(int j=1;j<=2;j++)
    {
     cout <<"masukkan data S["<<i<<","<<j<<"]=";
     cin>> S[i][j];
     }
    }

    for (int i=1;i<=2; i++)
   {
   for (int j=1; j<=2; j++)
   {
    cout <<S[i][j];
    if(j==2)
   
     cout<<"\n";
   }
    }


puts("\n TUGAS LOGIKA & ALGORITMA KELAS 11.1B.27 PERTEMUAN 9 ");

puts(" --------------------------------------------------- ");

getch();
}

++http://tugas851.wordpress.com/

Selasa, 18 Desember 2012

FLOWCHART

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{

char kode[10];

float harga, jumlah, bayar, total, discount;
clrscr();
cout<<"\n kode:";gets(kode);
cout<<"\n harga:";cin>>harga;
cout<<"\n jumlah:";cin>>jumlah;

bayar=harga * jumlah;

if(bayar>=100000)
          discount = 0.1 * bayar;
else
          discount = 0;

/*menghitung total*/

cout<<"======================"<<endl;
cout<<"Diskon = Rp. "<<discount<<endl;
total = bayar - discount;
cout<<"Cetak Total Bayar = Rp. "<<total;
cout<<"\n\n\n===terimakasih==="<<endl;
getch();
}