This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

0-9999 counter with c

can u make a counter for 0-9999 with c ?

Parents Reply Children
  • Lets just suppose we gave it to him, and he is indeed a student, then he will pass his classes without knowing how to do it.

    Then he gets a job somewhere and the real-world finds out he knows nothing.

    Does that increase the value of those who do know, or since the 'market is flooded' with 'graduates' does it devalue those in the know?

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

  • "Lets just suppose we gave it to him, and he is indeed a student, then he will pass his classes without knowing how to do it."

    I've worked with some pretty clueless people who shouldn't have been involved with embedded systems - But I think that even they were capable of writing code in C to count from 0 to 9999!

  • During the time that guy/gal is being tested out, someone is allocated as mentor, and after the first day starting to climb the walls. The mentor is probably someone the company relies on, so having him/her go nuts doesn't help the morale or efficiency of the RD department.

    At the same time, that junior did get some type of job to do. That job will not be finished unless someone else spends extra time doing it besides the ordinary assignments. Or maybe it will get finished, but have so bad quality that it is a disaster. But management comments that it can't really be that bad - just ship it and we fix any bug reports in due time.

    And the bad outcome of the experiment may make the company wary of trying out yet another potential fool, in which case the resident staff will have to continue with their overload for even longer. When the company finally gets someone worth keeping, it is already too late. The company has already grown enough that they would have needed two new developers. But having just received one new developer, marketing et al can't see why RD are complaining about being overworked since they just got a new guy.

  • In this case, we don't know if the goal is to count from 0 to 9999 as in a tiny C loop, but it might just as well be a request for some interrupt-driven code counting events and presenting on four 7-segment displays.

    All we know, is that the request was made from someone who was too impatient to describe the problem properly, and too impatient to spend a bit of own time figuring out possible solutions. A forum is great for helping someone who have done own work, but gotten stuck. Few forums likes to step in and do home assignments.

  • let's give him the code for a counter from 1..9 *smile*

  • But lets make it designed with four discrete 1-bit variables ;)

  • can u make a counter for 0-9999 with c ?
    line 4 people up representing each digit and have #1 wiggle the fingers, when he has wiggled all fingers, then #2 wiggles one.

    Erik

  • All things considered:
    The use of 'text' speak is suspicious.
    Perhaps he was using his cell phone during a test for a quick answer of how to make a counter? I know in the US cell phones are banned from all class rooms due to kiddies cheating via texting during tests. This sort of thing is human nature, find the easy route out of a problem, not necessarily know how to answer the question.

  • And the test was probably a form with yes/no answers.

  • Is it?

    It seems that most new users (on this and many other forums) assume that it is the default encoding.

    :-(

  • > Then he gets a job somewhere and the real-world finds out he knows nothing. <

    Well, if he gets a job somewhere, then the real-world will not find out he knows nothing. The one who finds out he knows nothing, will soon be punished, for the finding.

  • i got sum code .here it is when u need it.

    for ( i = 0 ; i != 9999 ; i = i + one )

    ;

    i = 9999 ;

  • "i got sum code .here it is when u need it."

    Thanks for sharing with us.

    Complex, yet beautiful in its simplicity. Pure genius.

  • On one hand, you haven't defined "one". On the other hand - would "one" be allowed to be given any value, or might your little counter possibly get into troubles for some values for "one"?

    If you intend "one" to always be the value 1, why would you create a named variable or constant "one"? That is about as clever as creating a variable for pi named m3_1415926535. Having a constant with the same name as the value normally don't help, with a few exceptions. Having a constant is something you do to not have to remember the actual value, or to allow the constant to be changed. But as already mentioned - would it be allowed to change "one" to another value and would some values be unsafe?

    Is there a reason for both having a loop and a direct assign of i = 9999?

    And what is the data type for i?

    By the way - did you post the code to have us check it out, or to help others who wants to know how to create a counter that counts to 9999?