Find Out Prime or Composite
Problem Overview
- Determine for each integer in a list whether it is Prime or Composite.
- Input: an integer N followed by N space-separated integers; Output: N lines of "Prime" or "Composite".
- Fits number theory tasks in data validation and cryptography contexts.
- Cisco interview question often used as a coding interview problem.
- Prime numbers are defined as having no positive divisors other than 1 and themselves.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
