Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
409 B
2
Indexable
Never
#include <stdio.h>
int main(){
	int uang;
	int harga;
	int jumlah;

	while(uang != 0){
		printf("Uang Badu: ");	
		scanf("%d", &uang);
		
		printf("harga barang: ");	
		scanf("%d", &harga);
		
		printf("jumlah barang: ");	
		scanf("%d", &jumlah);
		
		int totalHarga = harga * jumlah;
		uang = uang - totalHarga;
		if (uang < totalHarga){
			printf("UANG BADU KURANG!! \n");
		}
	}
	
};