Here is the updated code. It seems like it is reversing the numbers correctly but I still keep winning $1000 each time, even when I shouldn't. Any ideas why?
Code:
/*
My name is Jack Trocinski
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int lotto, i, revten, revtens, revone, rev, revteni, revonei;
printf("LOTTERY\n");
printf("Enter your two digit number for a chance to win: ");
scanf("%d", &lotto);
printf("\n");
revten = lotto%10;
revtens = revten * 10;
revone = lotto/10;
rev = revtens + revone;
srand(time(NULL));
i = rand()%(100 - 10 + 1) + 10;
printf ("Today's winning number is: %d. \n", i);
revteni = (i%10);
revonei = i/10;
if (lotto == i)
printf("Congratulations you have just won $10,000!");
else if (rev == i)
printf("Congratulations you have just won $3,000!");
else if ((revten || revone) == (revteni || revonei))
printf("Congratulations you have just won $1,000!");
else printf("Sorry, your luck ran out this time. Play again some other time!");
return 0;
}