Anonymous
learning basics and then going to work
I've been learning basics for years, even today when given a blank screen and asked to code something , I'm terrified. Because I don't know what to write
Anonymous
If u don't know how - google it like "how to do *your request*
Yeah and I often endup is stack overflow which is being my understanding, I've developed a habit of telling reasons and not trying, when learning the piano, I didn't do this I was interested, but I never knew I was Interested, now with programming, I am interested but I say reasons and never practice
Anonymous
If you need more digits then you have to use arrays
Hello sir cn u tell me how to use arrays for big numbers im dealing with really big numbers bikker than unsigned long
Anonymous
Bigger*
Anonymous
Can anyone provide me good stuff for enhancing my CP skills ? #algorithms and #DS
Serenity
I have no idea why STRTOL doesn't work.
Girish Kumar
Can anyone provide me good stuff for enhancing my CP skills ? #algorithms and #DS
Go to geeksforgeeks website. It has lots of content on DS and algorithms.
Airton
Can anyone provide me good stuff for enhancing my CP skills ? #algorithms and #DS
Look for "Data Structures Handbook" on google, the first link. Helped me a lot on CP.
Airton
Thanks a lott dude
You're welcome. Anything you need, just shout.
Anonymous
Look for "Data Structures Handbook" on google, the first link. Helped me a lot on CP.
@Airtonfel is that a Google app ? Or pdf I am getting a Google site app
Airton
Its a website and app
Airton
I think you can find the same content in mobile app
Airton
Both with same examples and hints
Airton
Its a very good stuff
Anonymous
Oky bro thanks a lott
Airton
Any doubts, mention me
Airton
👍👍
Anonymous
Yaah surw
Serenity
Can somebody help me use strtoul ?
Youssef
Hello sir cn u tell me how to use arrays for big numbers im dealing with really big numbers bikker than unsigned long
Wrote your own function to do operations on array or use The GNU Multiple Precision Arithmetic Library does what you want http://gmplib.org/
Serenity
printf(QUESTION1_INPUT_MESSAGE); char bin_num[MAX_SIZE]; int FLAG = 1; scanf("%s", bin_num); int i = 0; while (bin_num[i] != '\0') { if ((bin_num[i] != '1') && (bin_num[i] != '0')) { printf(QUESTION1_ERROR_MESSAGE); FLAG = 0; break; } i++; } if (FLAG == 0) break; else { unsigned long long int ret; ret = strtoull(bin_num,NULL,10); printf("%llu", ret); } break;
Serenity
Why doesn't my code work with strings longer than 10 letters ?
Serenity
Can you help me ?
Anonymous
Any one can help me by answering this?
Anonymous
Any one can help me by answering this?
Any one can answer please?
Raven49
Why is the code incorrect ? We have to display factorials of n test cases .
Raven49
/warn
What is wrong with this ?
Anonymous
Screen foto
Anonymous
Any one can help me by answering this?
1 data/extra/bss 2 stack 3 overflow 4 no, example you can write on your own 5 no, value only 6 https://stackoverflow.com/questions/30717258/how-object-cout-prints-multiple-arguments/30717624#30717624 7 (k<m && k>-m)? 1 : 0 8 procedural? 9 b 10 no because float comparisons are not recommended 11 when he is bored. Anything a while loop can do a for loop can also do 12 read up on loops 13 no, explain yourself 14 no, explain yourself
Anonymous
Now that I've answered your question
Anonymous
Any one can help me by answering this?
/report read group rules, asking homework here isn't allowed
Raven49
Screen foto
But then how will I share my doubt ?
Anonymous
Type it in
Anonymous
Anonymous
To find a factorial u just need a single number
Raven49
What values are u assigning to arr1?
The numbers whose factorial is to be determined are being assigned to arr1 And their factorials are assigned to arr2 That's my approach .
Anonymous
So ur calculating multiple factorials?
Raven49
In the question it says that the number of test cases is <=100 And the value of the number whose factorial is to be determined is also <=100 But do I have to change my code for that information ?
Raven49
Raven49
This is the exact question
Anonymous
Why is the code incorrect ? We have to display factorials of n test cases .
Whats the output i mean where is it showing incorrect
Raven49
This is my input -output
Anonymous
This is the exact question
for(int i=1; i<=n;++i) fact(i)
Raven49
Anonymous
This is my input -output
This is correct isnt it?
Anonymous
long long fact(int n) { if(n>1) return n * fact(n-1); return 1; }
Anonymous
Code the rest yourself
Raven49
Please see on top it is showing that it's wrong answer
Anonymous
You copy and paste the code
Anonymous
Use long long instead of int
Anonymous
Posting screenshot is not allowed
Anonymous
Because when ur test casing they will try large numbers and large numbers need more bits to store the number
Raven49
Posting screenshot is not allowed
I won't do this from next question onwards Just this time
Anonymous
Anyway unless you can't see I've solved your question above
Anonymous
You can code the rest yourself
Raven49
Why not do it properly right now?
Because I am coding on pc and I am using telegram on phone
Anonymous
Int can only hold 4 bytes long long can hold 8 bytes
Anonymous
Replace all "int" with long long
Anonymous
Nobody is going to ask the factorial of 2 million
Anonymous
No living person, no
Anonymous
But random test cases maybe
Raven49
Nobody is going to ask the factorial of 2 million
Actually in this question the largest number whose factorial has to be determined is <=100
Anonymous
Use unsigned int then
Raven49
On using long long it is giving a runtime error
Raven49
Use unsigned int then
What will be the syntax then ?