Question
Write a program that takes an integer as a command line argument and checks if its a prime number using MPI with C language. Your
Write a program that takes an integer as a command line argument and checks if its a prime number using MPI with C language.
Your program should print out the result of the primality test of each process then the final result,
Sample input/output:
- If the input number is 1299829, the output if you run your program using two processes should be:
Local Result of process 0 is not Prime because it is divisible by 59.
Local Result of process 1 is Prime.
The Number 1299829 is not Prime
- If the input number is 1299827, the output if you run your program using two processes should be:
Local Result of process 0 is Prime.
Local Result of process 1 is Prime.
The Number 1299827 is Prime
Save your program with the name YourName_Prob2.c.
THANKS IN ADVANCE!
Step 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