So I'm on university doing 3th grade of computer sciende (a 4 year career) but I have no idea on how to code so it was actually quite hard for to me to pass this semester (who would have thougth!?).
Becouse of this I decided to start learning C again, I did learn to code in pseudocode and C in first year but forgot how to.
Today I was trying to make an algorithm that would return all the A, B, and C variables (all between 0 and 9) such that (10A+B)/(10B+C)=A/C becouse the solutions are nice and I had already solved the equation by hand and already knew all the solutions. But I just can't make it work, I'm using an online C compiler and it doesn't show any error so I guess it's stuck in a loop.
This is my sloppy code;
Code:#include <stdio.h> int main () { int a, b, c, d, e; while (a + b + c != 27) a = 0; b = 0; c = 0; a = a++; if (a = 9) a = 0; b = b + 1; if (b = 9) c = c++; d = (10 * a + b) / (10 * b + c); e = a/c; if(d=e) printf ("%d",a); printf ("%d",b); printf ("%d",c); return 0; }
Thanks!