Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C code please, You need to write aprogram that will read a sequence of integers from the standard input. For each integer greater than
In C code please,
You need to write aprogram that will read a sequence of integers from the standard input. For each integer greater than 1, the program will test whether it is a prime number and print the result. The program will end the first time it reads a number which is 1 or less than 1 Input The input consists of a squence of integers separated by whitespace, such as spaces or newlines, and it is guaranteed that at least one of those numbers is 1 or less than 1 Output For each number n from the input, where n > 1, the program will print the following line if n is prime: n IS PRIME or the following line if n is not prime n IS NOT PRIME Sample input and output are given below: Sample Input Sample Outpu 3 IS PRIME 9 IS NOT PRIME 17 IS PRIME 13 IS PRIME 17 13 1 Sample Output, with visualized whitespace 3 IS PRIME 9-1S.NOTCPRIME 17 IS-PRIMEL 13 IS PRIMEE Note: is a space, and is a newline characterStep 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