Aspire Systems Interview Question

OOPS concepts and String based code we should solve by without using inbuilt functions and prime number