Write a function that takes integer n as a parameter this


Random Palindrome: Write a function that takes integer N as a parameter. This function then generates N random digits (numbers between 0 and 9) using the computer time as the seed of the random number generator.

The probability that a generated digit is even is 80% whereas the probability that a generated digit is odd is 20%.

The function then concatenates the N randomly created digits to form one number. This function then checks if this number is a palindrome or not. (Hint: find the reverse of that number) Finally, the function prints out the number and says whether it is a palindrome or not.
Example]:

Please enter the length of a number: 6
The concatenation of the 6 randomly generated numbers is: 258852 The number is a palindrome!
Example2:
Please enter the length of a number: 5
The concatenation of the 5 randomly generated numbers is: 86824 The number is a NOT a palindrome!

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a function that takes integer n as a parameter this
Reference No:- TGS02708378

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)