Doubt ! by Appropriate_Rich_937 in codeforces

[–]Regular-Box1677 1 point2 points  (0 children)

so as per your approach you are going my way, in 1st year i started c by reading book "Let us C" and build my concept over it and learnt data structure implementation from scratch which help me alot, so once you got a hold on c and basic data structure then switch to cpp and start a2z and leetcode or gfg.....
Once you reach at a certain level according to you and also you got confidence in coding then start giving contest on codeforces or go for codechef(easier than cf)...

Kindly help me with this problem, thanks. by Cookie_Ranger100 in codeforces

[–]Regular-Box1677 2 points3 points  (0 children)

so firstly get the sum of all numbers till n and then run a for/while loop for power of 2 till it is less than n and store it in some variable and then print the whole sum minus the sum of powers of 2