Von Neumann problem

It is showing warning “non void function contains no return function” as an error , please help

@paras.bisht share your code so that i can take a look

#include
using namespace std;

int convert(int arr[], int n)
{

int dec_value [50]={0};



for(int i=0; i<n ;i++)
{
  int base = 1;
 while (arr[i]>0) {
    int last_digit = arr[i] % 10;
    arr[i] = arr[i] / 10;
    dec_value[i] += last_digit * base;
    base = base * 2;
}

// 	cout<<dec_value[i]<<endl;

}

for(int i=0; i<n ;i++)
{
cout<<dec_value[i]<<endl;
}
}
int main()
{
int n;
cin>>n;

int arr[50];

for(int i=0; i<n ;i++)
{
	cin>>arr[i];
}

convert(arr,  n);

return 0;

}

@paras.bisht just change your function int convert to void convert it will work.
is it ok?

@paras.bisht if its cleared dont forget to mark it as resolved in my doubts section :smiley:

It is still showing the same error.

#include
using namespace std;

void convert(int arr[], int n)
{

int dec_value [50]={0};



for(int i=0; i<n ;i++)
{
  int base = 1;
 while (arr[i]>0) {
    int last_digit = arr[i] % 10;
    arr[i] = arr[i] / 10;
    dec_value[i] += last_digit * base;
    base = base * 2;
}

}

for(int i=0; i<n ;i++)
{
cout<<dec_value[i]<<endl;
}

}
int main()
{
int n;
cin>>n;

int arr[50];

for(int i=0; i<n ;i++)
{
    cin>>arr[i];
}

convert(arr,  n);
return 0;

}

here see this it works
is it ok now @paras.bisht?

see below using namespace std;
it should be void not int


#include
using namespace std;

void convert(int arr[], int n)
{

int dec_value [50]={0};



for(int i=0; i<n ;i++)
{
  int base = 1;
 while (arr[i]>0) {
    int last_digit = arr[i] % 10;
    arr[i] = arr[i] / 10;
    dec_value[i] += last_digit * base;
    base = base * 2;
}

}

for(int i=0; i<n ;i++)
{
cout<<dec_value[i]<<endl;
}
}
int main()
{
int n;
cin>>n;

int arr[50];

for(int i=0; i<n ;i++)
{
	cin>>arr[i];
}

convert(arr,  n);
return 0;

}

see your error says int convert you haven’t changed @paras.bisht

It is still not working I have sent you the pic of compiled output


copy this code correct and paste in hackerblocks then submit and tell

Is it possible i can share my screen with you in real time

have u submitted the code that i provide link of?

just submit it one time then i can see what you have submitted then we can talk

yeah I have done it, the code is working fine there

ok so the problem is in your system compiler?

I have no idea, when i am trying run it on the code editor provided to submit the solution it is showing error.

can you talk to me on whatsapp ?there you can send me the photos efficiently