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...
User Profile
Collapse
Profile Sidebar
Collapse
george8000
Last Activity: Jul 28 '12, 11:39 AM
Joined: Jul 28 '12
Location:
-
how to make a recursion count up and stop at its input
-
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 -
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
No activity results to display
Show More
Leave a comment: