#include"stdio.h"
#include"conio.h"
void main (){
int i, kode[5], jumlah[5], jumdata=3;
char*produk;
float harga,total;
printf ("\ Input Data Penjualan");
for (i=0 ; i <=jumdata; i++){
printf ("\ Kode Produk:"); scanf ("%d", & kode [1]);
printf ("\ Jumlah Produk :"); scanf ("%d", & jumlah[i]);
}
clrscr ();
printf ("\n Informasi Penjualan Produk");
printf ("\n--------------------------------------------------");
printf ("\n No Kode Produk Harga Jumlah Total");
printf ("\n--------------------------------------------------");
for (i=0;i<=jumdata;i++){
if (kode [i]==1){
produk = "TV"; harga=2000000;
}else if (kode [i]==2){
produk = "DVD"; harga=650000;
}else if (kode [i]==3){
produk = "CD ROOM"; harga=4500000;
}
total = harga * jumlah [i];
gotoxy (1,6+i); printf ("%i %d %s ",i+1, kode [i], produk);
gotoxy (30,6+i); printf (" %10.0f %i %10.0f", harga, jumlah [i], total);
}
printf ("\n-----------------------------------------------");
}
Sumber : mesran.net
#include"conio.h"
void main (){
int i, kode[5], jumlah[5], jumdata=3;
char*produk;
float harga,total;
printf ("\ Input Data Penjualan");
for (i=0 ; i <=jumdata; i++){
printf ("\ Kode Produk:"); scanf ("%d", & kode [1]);
printf ("\ Jumlah Produk :"); scanf ("%d", & jumlah[i]);
}
clrscr ();
printf ("\n Informasi Penjualan Produk");
printf ("\n--------------------------------------------------");
printf ("\n No Kode Produk Harga Jumlah Total");
printf ("\n--------------------------------------------------");
for (i=0;i<=jumdata;i++){
if (kode [i]==1){
produk = "TV"; harga=2000000;
}else if (kode [i]==2){
produk = "DVD"; harga=650000;
}else if (kode [i]==3){
produk = "CD ROOM"; harga=4500000;
}
total = harga * jumlah [i];
gotoxy (1,6+i); printf ("%i %d %s ",i+1, kode [i], produk);
gotoxy (30,6+i); printf (" %10.0f %i %10.0f", harga, jumlah [i], total);
}
printf ("\n-----------------------------------------------");
}
Sumber : mesran.net
0 komentar:
Posting Komentar