Question: Write in simple C code - You need to write aprogram that will read a sequence of integers from the standard input. For each integer

Write in simple C code -

Write in simple C code - You need to write aprogram that

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 than1 Output For each number n from the input, where > 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: 3 IS PRIME 9 IS NOT PRIME 17 IS PRIME 13 IS PRIME 17 13 Sample Ouput, with visualized whitespace 3-IS PRI IS NOTHPRIME 17 ISJPRIMEE 13uISLPRIMEE Note:is a space, and s a newline character

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!