Answer to Question #313621 in C++ for jane

Question #313621

Write a program which takes a 9-digit number input from user, converts it into its reverse

and then display one of the following statements


1
Expert's answer
2022-03-19T02:24:20-0400

Here is program:

int main()
{
    int t, a, p;
    cin >> t;
    int* s = new int[t];
    for (int i = 0; i < t; i++)
    {
        cin >> p >> a;
        b = 1;
        while ((a * b - 1) % p != 0)
        {
            b++;
        }
        s[i] = b;
    }
    for (int i = 0; i < t; i++)
    cout << s[i] << endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog