Advertisement
RieqyNS13

Untitled

Feb 4th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <iomanip>
  4. using namespace std;
  5. int main(){
  6.     char *kode_barang[] = {"b1", "b2", "b3", "b4", "b5"};
  7.     char *nama_barang[] = {"Monitor", "Keyboard", "Mouse", "Joystick", "Speaker"};
  8.     unsigned long int harga_barang[] = {10000, 15009, 506, 3697, 264};
  9.     char input_barang;
  10.     int size=sizeof(kode_barang)/sizeof(int);
  11.     cout<<"Kode\t"<<"\tBarang\t"<<"\tHarga\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
  12.     for (int a=0; a<size; a++){
  13.         cout<<setiosflags(ios::right)<<kode_barang[a]<<"\t\t"<<nama_barang[a]<<"\t\t"<<setiosflags(ios::right)<<harga_barang[a]<<endl; 
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement