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
  • > i got sum code .here it is when u need it.
    >
    > for ( i = 0 ; i != 9999 ; i = i + one )
    >
    > ;
    >
    > i = 9999 ;

    I have a quicker solution:

    int i=0;
    while(i++<9999);
    

    or, the hard way:

    int *i=(int *) malloc(sizeof(int));
    
    memset(i, 0, sizeof(int));
    
    while(*i++<9999);
    

    or ... after reading your code ... a much quicker solution:

    int i = 9999;
    

    *smile*

    BR,
    /th.

Reply
  • > i got sum code .here it is when u need it.
    >
    > for ( i = 0 ; i != 9999 ; i = i + one )
    >
    > ;
    >
    > i = 9999 ;

    I have a quicker solution:

    int i=0;
    while(i++<9999);
    

    or, the hard way:

    int *i=(int *) malloc(sizeof(int));
    
    memset(i, 0, sizeof(int));
    
    while(*i++<9999);
    

    or ... after reading your code ... a much quicker solution:

    int i = 9999;
    

    *smile*

    BR,
    /th.

Children