summaryrefslogtreecommitdiff
path: root/node_modules/shiki/samples/cpp.sample
blob: 5a78d84b12e8b274640f4c87b9307c2d1cf1a4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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