I set you on the right track... showed you an example of how to do this...
Now it's up to you to study and learn, then fix your own code.
I am not going to do your homework for you.
Type: Posts; User: CommonTater
I set you on the right track... showed you an example of how to do this...
Now it's up to you to study and learn, then fix your own code.
I am not going to do your homework for you.
But then you declare a new copy of N inside your random number function. This internal variable masks (hides) the one in main and is used in an uninitialized state in your function. You should be...
First... indent your code properly and leave blank lines between sections. Done properly you will have a visual indication of how your code works.
So, what's the problem with it?
What error...