Hello everybody, pleased to be here. I'm relatively new to programming, just took up learning C a few weeks ago (and not that actively either).
I've run into an assignment that my mentor said "could" be appropriate, but that there's a simpler solution (which she did not say of course -_-), but when I wrote the code in Microsoft Visual Studio C++, the debugger returned no errors, but I can't seem to understand why I get nothing as a result (actually, instead of a number result, I get "-858993460").
The code SHOULD be doing the following: The user types the values of N and M, where N is the number of natural numbers (is it "natural" in English? All whole numbers above 0 that is :P) and M is the paramater. The program is supposed to find the biggest number from 0 to N whose summary of digits is equal to M.
Here's the code I wrote:
printf("Type in the amount of numbers \n");
printf("Type in the M paramater \n");
printf ("The greatest number whose sumary of digits is equal to M is %d \n",max);