User Profile

Collapse

Profile Sidebar

Collapse
george8000
george8000
Last Activity: Jul 28 '12, 11:39 AM
Joined: Jul 28 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • how to make a recursion count up and stop at its input

    at the moment my code counts backwards by i need it to count forward while keeping the recursion. I cant get rid of it.

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <ctype.h>

    void printcount(int) ;

    int main(int argc, char *argv[]){

    int sum =0;

    if(argc == 2){ //checks if the arguments entered is exactly...
    See more | Go to post

  • george8000
    replied to isdigit to work with negative numbers
    in C
    Omg lol so simple, thanks heaps. I did however have to swap my if statements around aswell because the or statement for the - sign is true in both cases and tends to just output the first if statement
    See more | Go to post

    Leave a comment:


  • george8000
    started a topic isdigit to work with negative numbers
    in C

    isdigit to work with negative numbers

    Ok well i know that isdigit in my code is seeing the negatives as a character and so i made my program give an error message. But i need negative numbers to work how could i get this to work with negative numbers.

    The code is supposed to add the 3 numbers input into the command line argument including negative numbers.


    Code:
    #include <stdio.h>
    #include <stdlib.h> 
    #include <ctype.h>
    #include
    ...
    See more | Go to post
    Last edited by Rabbit; Jul 28 '12, 11:35 PM. Reason: Please use code tags when posting code.
No activity results to display
Show More
Working...