Input : n = 5, m = 100
Output : 8
The numbers with odd factors are 9, 16, 25,
36, 49, 64, 81 and 100
Input : n = 8, m = 65
Output : 6
Input : n = 10, m = 23500
Output : 150
source code:-
#include <bits/stdc++.h>
using
namespace
std;
int
Squares(
int
n,
int
m)
{
return
(
int
)
pow
(m,0.5) - (
int
)
pow
(n-1,0.5);
}
// Driver code
int
main()
{
int
n = 5, m = 100;
cout <<
"Count is "
<< Squares(n, m);
return
0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন