sample input and output is correct but on submitting the code i am getting wrong answer on all the test cases
#include
using namespace std;
int oct(int n);
int main() {
int n;
cin>>n;
int no = oct(n);
cout<<no;
return 0;
}
int oct(int n){
int r,no=0;
while(n!=0){
r=n%8;
n/=8;
no=no*10+r;
}
return no;
}