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
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;
}
Comments
Leave a comment