1.

Question1. Design a class PrimePalinGen to generate prime palindrome numbers. [ A numberis saidto be prime palindrome if the number is a prime as well as a palindrome number ][ Prime number: A number having only two factors i.e. 1 and itself ][ Palindrome number: A number which is same as its reverse ]Example: 11(where 11 is a prime number and a palindrome number)Some of the members of the class are given below: [10]Class name : PrimePalinGenData members/instance variables:start : to store the start of rangeend : to store the end of rangeMethods/Member functions:PrimePalinGen (int a, int b) : parameterized constructor to initialize the datamembers start=a and end=bint isPrime(int i) : returns 1 if the number is prime otherwisereturns 0int isPalin(int i) : returns 1 if the number is a palindromeotherwise returns 0void generate( ) : generates all prime palindrome numbersbetween start and end by invoking thefunctions isPrime() and isPalin().Specify the class PrimePalinGen giving details of the constructor( ),int isPrime(int), intisPalin(int) and void generate( ).Define a main( ) function to create an object andcall the functions accordingly

Answer»

Explanation:

FIND the value of m so that the QUADRATIC EQUATION px^2 + (p – 1) x +(p – 1) = 0 has equal roots.



Discussion

No Comment Found