Friday, March 17, 2006

hey..in my midst of mugging for the coming exams..or rather trying to catch up what I've been lagging behind lar..I just want to share with u guys what a horrible subject computing is.haaa..
cheers..

/* Program to express fraction as int+fraction */
#include
int main(void)

{
int numerator, denominator, integer, n, d, value;

printf("Please enter the numerator of the fraction:");
scanf("%d", &numerator);
printf("Please enter the denominator of the fraction:");
scanf("%d", &denominator);

n=numerator;
d=denominator;
integer = (int) n/d;
do
{
value=n;
n=d;
d=value%n;
}while (d!=0);

d=denominator/n;
n=(numerator-integer*denominator)/n;

printf("The fraction is equal to %d+%d/%d.\n", integer, n , d);

return 0;
}



Anonymous rocking off at 3:00 PM

***





Hwa Chong Junior College
03S73

sentosa 2003

prom 2004


[[* February 2005 *]]
[[* March 2005 *]]
[[* April 2005 *]]
[[* May 2005 *]]
[[* June 2005 *]]
[[* July 2005 *]]
[[* August 2005 *]]
[[* September 2005 *]]
[[* October 2005 *]]
[[* December 2005 *]]
[[* January 2006 *]]
[[* February 2006 *]]
[[* March 2006 *]]
[[* April 2006 *]]
[[* May 2006 *]]
[[* June 2006 *]]
[[* July 2006 *]]
[[* September 2006 *]]
[[* October 2006 *]]
[[* November 2006 *]]
[[* December 2006 *]]
[[* January 2007 *]]
[[* February 2007 *]]
[[* March 2007 *]]
[[* April 2007 *]]
[[* May 2007 *]]
[[* June 2007 *]]
[[* August 2007 *]]
[[* September 2007 *]]
[[* October 2007 *]]
[[* December 2007 *]]
[[* January 2008 *]]
[[* March 2008 *]]
[[* May 2008 *]]
[[* July 2008 *]]



*Mrs Goh!
*Chewy
*Qingzhao
*Jaymie
*Jiaho
*05s73
*06s73