Given the following C++ program, draw the corresponding flowchart using Visio 20
ID: 3671759 • Letter: G
Question
Given the following C++ program, draw the corresponding flowchart using Visio 2013.
#include
using namespace std;
int main()
{
cout << "Enter a number: ";
int n;
cin >> n;
if (n > 10)
cout << n << " is greater than 10" << endl;
else if (n < 5)
cout << n << " is less than 5" << endl;
// could add more else if statements here
else
cout << n << " is between 5 and 10" << endl;
return 0;
}
Given the following flowchart, develop and test the corresponding C++ program using Visual Studio Enterprise 2015.
Explanation / Answer
int main()
{
cout << "Enter a number: ";
int n;
cin >> n;
if (n > 10)
cout << n << " is greater than 10" << endl;
else if (n < 5)
cout << n << " is less than 5" << endl;
// could add more else if statements here
else
cout << n << " is between 5 and 10" << endl;
return 0;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.