someone please specify the errors in this code as i am clearing test cases on my compiler...plzzz

#include
using namespace std;
int main()
{
int n,i,s,r,p;
long t;
s=0;
cout<<"enter the no of cases: ";
cin>>n;
cout<<“enter the no:”;
cin>>t;
for(i=1;i<=n;i++){
r=t%10;
s=s+r;
t=t/10;
if(t== 0)
break;
}
cout<<s<<endl;
return 0;
}

Provide solution link.

Generally speaking it is a mistake for CodeChef submissions to output any kind of entry prompt. The output should be only and exactly what is requested by the problem. The input is provided without prompting.

As @babangain says, it’s hard to help with a specific problem without knowing which specific problem it is. A link to a submitted solution on CodeChef means the code is in good format and also indirectly gives a link to problem itself.

//