#include
int main() {
int N{0};
int P{0};
cin>>N>>P;
float ans=1.0;
float inc =1.0;
for(int times=0;times<=P;times++)
{
while(ans*ans<=N){
ans=ans+inc;
}
ans=ans-inc;
inc=inc/10;
}
cout<<ans<<endl;
#include
int main() {
int N{0};
int P{0};
cin>>N>>P;
float ans=1.0;
float inc =1.0;
for(int times=0;times<=P;times++)
{
while(ans*ans<=N){
ans=ans+inc;
}
ans=ans-inc;
inc=inc/10;
}
cout<<ans<<endl;
using namespace std; is missing .
#include iostream
using namespace std;
…
…
thanks
no sir i have used both header files
I am not talking about header files… this is about namespace.
using namespace std;
if you have used this line, then this code is working properly. what is the error you are facing?
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.