Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream.h"
- #include <conio>
- main () {
- int a,c,p,u,k,x;
- char b;
- char v [100];
- c=0;
- u=0;
- awal: clrscr();
- cout<<"\nMasukkan Kode Barang : ";cin>>x;
- cout<<"\nMasukkan NAMA Barang : ";cin>>v;
- cout<<"\nMasukkan Harga Barang : Rp.";cin>>k;
- cout<<"\nMasukkan Jumlah Barang : ";cin>>a;
- c=c+a;
- cout<<"\nISI DATA LAGI [y/n] ";cin>>b;
- if (b=='y')goto awal;
- else if(b=='n')goto hasil;
- hasil:
- clrscr();
- cout<<"\n\nJumlah Barang : "<<c;
- u=(u+k)*c;
- cout<<"\nTotal Harga Barang : Rp."<<u;
- cout<<"\nBayar : Rp." ;cin>>p;
- cout<<"\nKembali : Rp." <<p-u;
- getch();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement