Odd even back in delhi

Please guide me as i am having confusion like how should i assign num1 and num2 in main …also correct me in this code…it is not complete yet

include

using namespace std;

int calcnum1(int n){
int j1,num1=0, num2=0;

int N;
for (int i = 0; i < n; i++){
    cin>>N;
    while (N>0)
    {
       j1=N%10;
       if (j1%2 == 0)
       {
           num1 += j1;
           
       }
       else if (j1 %2 != 0 )
       {
          num2 += j1;
       }
       
       N /= 10;
      }

    }
 return num1,num2;   

}

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

return 0;

}

@abhinavssr2003_eab0717682969e5c,
what u want to do which question is this?
i’ll comment and correct the code dont worry

i am sorry…by mistaken i posted it in some other doubt sec

should i post it in odd even one or you get my prob?

@abhinavssr2003_eab0717682969e5c just add there once, ill get the content for that then

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.

IS IT CORRECT NOW??

include

using namespace std;

void oddeven(int n){

int j,sumodd=0, sumeven=0;



int no;

for (int i = 0; i < n; i++){

    cin>>no;

    while (no>0)

    {

       j=no%10;

       if (j%2 == 0)

       {

          sumeven += j;

           

       }

       else if (j %2 != 0 )

       {

          sumodd += j;

       }

       

      no /= 10;

      }

      if (sumodd%3 == 0 || sumeven%4 == 0)

      {

          cout<<"Yes"<<endl;

      }

      else

      {

          cout<<"No"<<endl;

      }

               

    }

}

int main(){

int n;

cin>>n;

oddeven(n);

   

return 0;

}

@abhinavssr2003_eab0717682969e5c yeah almost
one last correction done here : https://ide.codingblocks.com/s/657290 and commented

1 Like

Thank You so much sir…IT cleared many concepts of mine

1 Like

@abhinavssr2003_eab0717682969e5c please mark questions as resolved

okay sir…i will do it next time