Monday, August 10, 2009

c

#include
int main (void)
{
double c1,c5,c10,c20,c50;
int sum,sum1,sum2,s1,s5,s10,s20,s50;
printf("Hi there ^^....Enter the amount 1cent u have\n");
scanf("%lf",&c1);
printf("Now enter the amount of 5cent u have\n");
scanf("%lf",&c5);
printf("Enter the amount of 10cent u have\n");
scanf("%lf",&c10);
printf("Enter the amount of 20cent u have\n");
scanf("%lf",&c20);
printf("Enter the amount of 50cent u have\n");
scanf("%lf",&c50);
s1=c1*1;
s5=c5*5;
s10=c10*10;
s20=c20*20;
s50=c50*50;
sum=(s1+s5+s10+s20+s50);
sum1=sum/100;
sum2=sum%100;
printf("Walao...u have RM%d and %d cent wei",sum1,sum2);
return(0);
}

No comments: