Find It in Number theory

I wrote down the code for this problem but it does not accept completely.
Code Link - https://ide.codingblocks.com/s/217482
can you please help to find out where I am going wrong.

Hi @imsaurabh

Link with changes : https://ide.codingblocks.com/s/218161

Make separate cases for numbers 1, 2 and 3. And for all other numbers run loop upto sqrt(val) , Add in both factors only if(i!=(val/i)).

Hope it Helps.

@Nayan04 Thank you for help. Got my mistake where i am doing wrong.