Why is this not accepting

#include

using namespace std;

int main()

{

int n;

cout << "Number of times the operation will run " << endl;

cin >> n;

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

{

    int num;

    cout << "Enter the number" << endl;

    cin >> num;

    int rem = (num % 10);

    if(num > 9)

    {

        while (num >= 10)

        {

            num = num / 10;

            while (num > 0 && num < 9)

            {

                int add;

                add = (num + rem);

                cout << add << endl;

                break;

            }

        }

    }

        else

        {while (num > 0 && num <= 9)

        {

            cout << (num + num%10) << endl;

            break;

        }

        }

   

}

return 0;

}

firstly , you havent mentioned the problem for which you have written the code, secondly i think it is not accepting because of those print statements, " enter the number" etc etc . get rid of them and i think it might get ac

Sorry for the missing info , actually I’m new to this. It’s for FLOW004 . As for the statements, I have submitted the code after commenting them as I know the output format given must match.

Thanks for the reply.

1 Like