Joined

·
837 Posts

Code:

```
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
int main()
{
float fraction, they = (5/3);
long int i,j;
printf("Input The Fraction, to the 6th decimal place, if possable:\n");
printf("?");
scanf("%f", &fraction);
for(i=-10000;i<0;i++)
{
printf("i:%d\n",i);
for(j=-10000;j<-1;j++)
{
if((i/j)==fraction)
{
printf("Your fraction(%f) is %d/%d\n", fraction,i,j);
}
}
}
for(i=1;i<10000;i++)
{
printf("i:%d\n",i);
for(j=1;j<10000;j++)
{
if((i/j)==fraction)
{
printf("Your fraction(%f) is %d/%d\n", fraction,i,j);
}
}
}
printf("%f %f\n", fraction, they);
if(they==fraction)
{
printf("hi");
}
return 0;
}
```