Pages

Monday, November 3, 2014

IF pada C





Unknown | 9:33 AM | 0 Comments



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

using namespace std;

int main()
{
char kb, nb;
int stuan, jb, tb, hb;
float th, pot,tot;
printf("--------------------------------------------------------------\n");
printf("\t \t MINI MARKET SERBA ADA \n");
    printf("--------------------------------------------------------------\n");
    //input
    printf("Kode Barang \t : ");scanf("%s",&kb);
    printf("Nama Barang \t : ");scanf("%s",&nb);
    printf("Satuan \t \t : ");scanf("%i",&stuan);fflush(stdin);
    printf("Jumlah Beli \t : ");scanf("%10.i",&jb);fflush(stdin);
    printf("Harga Beli \t : ");scanf("%i",&hb);fflush(stdin);
    printf("--------------------------------------------------------------\n");
   

    th = jb * (float)hb;

printf("Total Harga \t : Rp. %10.2f \n ",th);
if(th > 100000)
{
pot =0.1*th;
}
else
{
pot=0;
}
printf("Potongan \t : Rp. %10.2f \n ",pot);
printf("--------------------------------------------------------------\n");

tot = th-pot;
printf ("Total Bayar \t : Rp. %10.2f \n ",tot);
printf("--------------------------------------------------------------\n");
getch();
return 0;
}



By Unknown
A Short Description about youself







Stay Connected With Us
Feed Icon Twitter Icon Facebook Icon Google+ Icon Youtube Icon


Share and Spread Share On Facebook +1 This Post Digg This Post Stumble This Post Tweet This Post Tweet This Post Tweet This Post Save Tis Post To Delicious Share On Reddit Bookmark On Technorati


Related Articles

JOIN THE DISCUSSION

Any feedback, questions or ideas are always welcome. In case you are posting Code ,then first escape it using Postify and then paste it in the comments

0 comments: