Pythagoras triplet

Sir please check this code as this code is not working

#include
using namespace std;
print_Triplet(long long int n);
int main
{
long long int n;
cin>>n;
print_Triplet(n);
return 0;

}
print_Triplet(long long int n)
{long long int b,c;
if(n==1 or n==2 )
cout<<“No triplet exists”<<endl;
else if(n%2!=0)
{
b=(nn-4)/4;
c=(n
n+4)/4;
}
else if(n%2==0)
{
b=(nn-1)/2;
c=(n
n+1)/2;

}
cout<<b<<endl<<c;

return 0;
}

Hey @yash_aryan please share your code using ide.codingblocks.com
If you don’t know how to share it using ide.codingblocks.com you can also ask me that.

Sir please review this code

#include using namespace std; void print_Triplet(long long int n); int main() { long long int n; cin>>n; print_Triplet(n); return 0; } void print_Triplet(long long int n) { long long int b,c; if(n==1 or n==2) cout<<"-1"; else if(n%2!=0) { b=(nn-1)/2; c=(nn+1)/2; } else if(n%2==0) { b=(nn-4)/4; c=(nn+4)/4; } else cout<<"-1"; cout<<b<<"\t"<<c; }

Go to ide.codingblocks.com
Paste your code there
Press cntrl + s or go in file and then click on save
After that share the url with me , it will be like ide.codingblocks.com/s/23xxx

Have debugged your code here


it’s giving right output now.

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.