Question: C++ program help! The function should return a boolean value and it can use for any two positive numbers. Exercise 2 Recall that an integer

C++ program help! The function should return a boolean value and it can use for any two positive numbers.
Exercise 2 Recall that an integer is a prime number if it is divisible only by 1 and itself. Write a function called IsPrime that takes in one integer parameter X and determines whether or not X is prime. The function should return a bool value: 1. return true if X is a prime number return false if X is not a prime number. o o (Hint: The % operator is good for checking for divisibility of one integer by another) To test this function, write a main() routine that asks the user to input two positive integers N1 and N2 (you may assume the smaller number will be input first). Using your IsPrime() function, find and print all the prime numbers between N1 and N2, where the output has 8 numbers per line (you can use tab characters to separate numbers on a line) 2. 3. Sample Run (user input underlined) Please input two positive numbers: 230 700 The prime numbers between 230 and 700 are: 233 277 331 379 431 467 523 587 631 677 239 281 337 383 433 479 541 593 641 683 241 283 347 389 439 487 547 599 643 691 251 293 349 397 443 491 557 601 647 257 307 353 401 449 499 563 607 653 263 311 359 409 457 503 569 613 659 269 313 367 419 461 509 571 617 661 271 317 373 421 463 521 577 619 673
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
