21 lines
No EOL
420 B
Text
21 lines
No EOL
420 B
Text
// Working of implicit type-conversion
|
|
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
|
|
int num_int;
|
|
double num_double = 9.99;
|
|
|
|
// implicit conversion
|
|
// assigning a double value to an int variable
|
|
num_int = num_double;
|
|
|
|
cout << "num_int = " << num_int << endl;
|
|
cout << "num_double = " << num_double << endl;
|
|
|
|
return 0;
|
|
}
|
|
|
|
// From https://www.programiz.com/cpp-programming/type-conversion |