Below is an example of this datatype can be used. In C#, the datatype is denoted by the Boolean keyword. The variable is then assigned a value of 30.33.įrom the output, you can clearly see that the double variable called num was displayed in the console 3) BooleanĪ boolean data type is used to work with Boolean values of true and false. The double data type is specified to declare a double type variable called num.We will then assign a Double value to the variable and then display it accordingly. In our example, we will define a double variable called num. In C#, the datatype is denoted by the keyword “ Double“. In this case, the numbers are whole numbers like 10.11, 20.22 or 30.33. Output:įrom the output, you can clearly see that the Integer variable called num was displayed in the console 2) DoubleĪ double data type is used to work with decimals. If the above code is entered properly and the program is executed successfully, following output will be displayed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |