Login to Website

Login dengan Facebook

 

Post Reply
Thread Tools
  #1  
Old 20th November 2011
SinggahDapur
Ceriwiser
 
Join Date: Nov 2011
Posts: 348
Rep Power: 14
SinggahDapur mempunyai hidup yang Normal
Default [Cendol Inside] help me tugas C error di "MOD" ane kurang ngerti

Quote:





#include

int main()

{

short int jmlbungkus;

short int jmlcoklat;

short int coklatgratis;

short int sisa;

short int totalcokgratis;

printf(" Masukan jumlah bungkus permen ? :");

scanf("%d",& jmlbungkus);

do {

}

while (jmlcoklat>0 or jmlcoklat>1);



coklatgratis= jmlbungkus / 2;

sisa= jmlbungkus MOD 2 ;

jmlbungkus=coklatgratis+sisa;

totalcokgratis= coklatgratis+jmlcoklat;

printf("%d",totalcokgratis);





return 0;



}





yang di bold gan ...

ane lupa lagi MOD itu gimana ??/

hehehehe

pokoknya jmlbungkus dibagi terus 2 ?

tadi ane ga konsen pas dosen nerangin





help me gan

melon inside



Sponsored Links
Space available
Post Reply




Switch to Mobile Mode

no new posts