okay...here is my first try:
Code:
#include <stdio.h>
int main(void){
float num;
float num2;
int i1, i2;
printf("Please enter a float number : ");
scanf("%f",num); /*GETS FIRST FLOAT NUMBER */
while (num !=0) /*MAKES SURE ITS NOT 0 */
{
printf("Please enter a float number : ");
scanf("%f",num2); /*GETS SECOND FLOAT NUMBER */
/*turns it into fractions only*/
i1 = (int)num;
i2 = (int)num2;
num = num - i1;
num2 = num2 - i2;
/*compares and prints out the bigger one*/
if(num>num2)
{
printf("The number is %f.\n",num);
num=num2;
}
if(num2>num)
{
printf("The number is %f.\n",num2);
num2=num;
}
}
printf("DONE");
}
now for some reason that i cant understand i get "Access violation" error right after i enter first float number ....