Questions:
Dealing with Data (C++ Primer Plus Sixth Edition Solution Manual) Question-5
Explanation:
Below mention code is compiled in Visual Studio 2015 and Code Blocks 13.12,output snap is attached.. If any problem you feel and you want some explanation feel free to contact us.
Code:
Output:
Related Articles:
Dealing with Data (C++ Primer Plus Sixth Edition Solution Manual) Question-5
Explanation:
Below mention code is compiled in Visual Studio 2015 and Code Blocks 13.12,output snap is attached.. If any problem you feel and you want some explanation feel free to contact us.
Code:
/**************************************************|
/*************C++ Programs And Projects************|
***************************************************/
#include<iostream>
using namespace std;
void main() {
long float worldPopulation;
long float usPopulation;
long float result;
cout
<< "Enter the world's
population:";
cin
>> worldPopulation;
cout
<< "Enter the population
of the US:";
cin
>> usPopulation;
result
= (usPopulation / worldPopulation);
result
= result * 100;
cout
<< "The population of the
US is "
<< result<< "% of the world
population."
<< endl;
}
Output:
Related Articles:
0 Questions:
Post a Comment