What should i update in this to get ans

#include<bits/stdc++.h>
#include
#include
using namespace std;
bool isPossible(int a)
{
if(a==0 || a==1)
{
return false;
}
if(a==2)
{
return true;
}
else
{
for(int i=2;i<=sqrt(a);i++)
{
if(a%i==0)
{
return false;
}
}
}
return true;
}
void subarray(string s,int n)
{
int count=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
string temp="";
for(int k=i;k<=j;k++)
{
temp=temp+s[k];
}
int num;
istringstream(temp)>>num;
if(isPossible(num))
{
count++;
}
}
}
cout<<count<<endl;
}
int main() {
int n;
cin>>n;
string s;
getline(cin,s);
subarray(s,n);

}

Hello @guptanikhil898,

Please, share your code using Coding Blocks IDE.
The way you have shared may introduce many syntax errors to it.
STEPS:

  1. Paste it at https://ide.codingblocks.com/
  2. Save it there.
  3. Share the URL generated.

Hello @guptanikhil898,

You have almost same problems in your code as an another student.
I have mentioned all the mistakes in his code.
Refer to it:

Read the comments, they will help.

Let me know if you still don’t understand something.
I’ll correct your code also.

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.