72 216
Assignments Done
Successfully Done
In April 2019

Answer to Question #46367 in C for mater

Question #46367
Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number. (Note: An even number is prime if it is 2. An odd integer is prime if it is not divisible by any odd integer less than or equal to the square root of the number.)
Expert's answer
#include <stdlib.h>
//function to check Is Prime or not
bool IsPrime(int number) {
for (int i = 3; i < number; i++) {
if (number % i == 0) return false;
return true;
//main method
int main() {

//promt user to enter number
printf("Enter number: ");
int number;
//read number
// display it on screen
printf("Is prime number\n");
printf("Is NOT prime number\n");

//return 0
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions