Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pleazzzzzze solve it soon. use c++ max. runtime is 2 seconds Parta) The program will read in a non-negative integer which fits in a 32bit
Pleazzzzzze solve it soon.
use c++ max. runtime is 2 seconds Parta) The program will read in a non-negative integer which fits in a 32bit integer. The input is guaranteed to be correct. No error checking is needed. The program needs to report whether the input is a prime, and whether the input is an s-prime respectively. (See sample test cases) For information, PASS enforces a maximum runtime of 2000ms (i.e. 2 seconds) per test case. If the program takes longer than that, it will result in "Time Limit Exceeded" error and the program will not score any mark for that test case. Sample Input/Output: Example 1: (User Input is underlined) Input an integer: 12 12 is not Prime 12 (sum=3) is not s-Prime Example 2: (User Input is underlined) Input an integer: 13 13 is Prime 13 (sum=4) is not s-Prime Example 3: (User Input is underlined) Input an integer: 23 23 is Prime 23 (sum=5) is s-Prime Example 4: (User Input is underlined) Input an integer: 2147000117 2147000117 is Prime 2147000117 (sum-23) is s-PrimeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started