So I have some code to get some large numbers, and I am storing them in long
, but the output is still not correct because I get negative numbers.
Here is my code:
int user_want =0;
long answer=1;
int loop = 0;
printf("What is required?");
scanf("%d", &user_want);
for(loop=1;loop<=user_want; loop++){
answer = answer*loop
printf("%ld\n", answer)
}
I get this output:
Pls help!