76 255
Assignments Done
Successfully Done
In May 2019

Answer to Question #1497 in C++ for idaira

Question #1497
Write a program that let the user to enter any positive number and the program will tell the user if the number is a prime number or not a prime number. Allow the user to continue the process until the user enters a sentinel. For this program, you are required to use an alphabet as the sentinel. Use do-while loop for this program.
Expert's answer
#include <stdbool.h>
#include <stdio.h>

using namespace std;

bool is_simple(int count){
for(int i =2; i < count; i++){
if(count % i == 0)
return false;
return true;

int main(int argc, char * argv[]){

char * str;

int count;

str = new char[30];
cin >> str;

count = atoi(str);

printf("Is simple.
printf("Is not simple!


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