Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <conio.h>
- #include <windows.h>
- using namespace std;
- void gotoxy(int x, int y)
- {
- COORD coord;
- coord.X = x;
- coord.Y = y;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
- }
- int main(){
- int i,un[5],hg[20],total[20];
- char nm[10][5];
- cout<<"\tdatar nama barang\n";
- cout<<"==================================================\n";
- cout<<" No | nama | unit | Harga | Total\n";
- cout<<"==================================================\n";
- for(i=1;i>0;i++){
- gotoxy(1,3+i);cin>>i;
- gotoxy(5,3+i);cin>>nm[i];
- gotoxy(14,3+i);cin>>un[i];
- gotoxy(27,3+i);cin>>hg[i];
- total[i]=un[i]*hg[i];
- gotoxy(40,3+1);cout<<total[i];
- getch();
- }
- cout<<"\n";
- cout<<"===========================================\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement