Solution Review: Convert Double Value into Integer
Let's see the detailed solution review of the challenge given in the previous lesson.
We'll cover the following...
Solution #
Press + to interact
#include <iostream>using namespace std;int main() {// Initialize a variable of type doubledouble double_value = 70.968;// Prints value of variablecout << "double_value = " << double_value << endl;// Declare a variable of type intint integer_value;// Assign double value to variable of integer typeinteger_value = double_value;// Prints value of variablecout << "integer_value = " << integer_value;}
...