convert datatype from boolean to int code example Example: convert boolean to int int val = (bool) ? 1 : 0;