Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A prime number is a number which is only divisible by 1 or itself (eg: 5, 11 etc). A 'magic 3' number is a number

A prime number is a number which is only divisible by 1 or itself (eg: 5, 11 etc). A 'magic 3' number is a number whose repeated sum of digits till the number becomes one digit is 3 (eg: 30, 1335 etc). Write a function which takes an integer array as input and prints P if number is prime, M3 if number is 'magic 3' and PM3 if number is both prime and magic.By using GO-LANG

Input: 5, 3, 39, 11

Output: P PM3 M3 P

NOTE- Do not use library functions, Optimize the code And need output as Automatically not given by user

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions