Hello do you know why my output not looping ?
Even I already use "do" to make this code for looping..
#include <stdio.h>
#include <conio.h>
int main ()
{
int hari;
double duit;
do
{
printf ("Mari rent kerete...");
printf ("\nkalau 1 hari = 100");
printf ("\nkalau 2-4 hari = 70");
printf ("\nkalau 5 hari dan seterusnya = 50\n");
scanf ("%d", &hari);
if(hari==1)
{
duit = 100;
printf ("Duit%lf", duit);
}
else if((hari<=2)&&(hari>5))
{
duit = 100+(hari-1)*70;
printf("Duit : %lf", duit);
}
else if(hari>=5)
{
duit = 100+(hari-3)*70+(hari-4)*50;
printf ("Duit : %lf", duit);
}
else
break;
}
while (hari<1);
getch();
return 0;
}
Kindly reply your answer..