I am trying to obtain all the perfect squares between two values(both included). I tried the following code which gives me the count excluding the end values.
cin>>a>>b; n=(int)sqrt(b)-sqrt(a);
How can i get the count of perfect squares including the end values?
Just add boundary condition to your logic
how to fish - Pseudo code here
fish - here is the answer