Question 2 Part of program development is the visualization of the program using a flowchart Draw the flowchart for the
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 2 Part of program development is the visualization of the program using a flowchart Draw the flowchart for the
Question 2 Part of program development is the visualization of the program using a flowchart Draw the flowchart for the following program that determines iſ a given value of n is a prime number Winclude <iostream> using namespace std; int main() 1 //variable declaration int n; int flag = 0; //prompt user for input cout << "Enter an integer > 1: "; cin >> 7/iterate from 2 to n/2 for(int count-2: countcont2: count++) //in is divisible by any from 2 to n/2 //it is not a prime if (nacount -- 0) flag - 1; break; //output result if (flag - 0) cout <<n «" is a prime number\n"; else cout <<n<<" is not a prime number\n"; return 0; (10 marks) 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!