Monday 29 February 2016

Dealing with Data (C++ Primer Plus Sixth Edition Solution Manual) Question-5

Leave a Comment
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:

/**************************************************|
/*************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:
Dealing with Data (C++ Primer Plus Sixth Edition Solution Manual) Question-5


Related Articles:

C++ Primer Plus Sixth Edition Complete Solution Manual 

C++ Books Solution


Reference:

Answers to Chapter Reviews C++ Primer Plus

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: