DEV Community

Umid2008
Umid2008

Posted on

Types of Variables

Assalamu aleykum today we will take a look with you on Data types - data types.

include

using namespace std;

int main () {
int mynom = 5; / / All (whole number)
float myFloatNum = 5.99; // decimal
double myDoubleNum = 9.98; / / differs in its limit with decimal Float.
char myLetter = 'D'; / / Char
boolean myBoolean = true; / / Boolean(true or false
string myText = "Hello"; / / line
}
Main types of data

The data type determines the size and type of information that stores the variable:

Image description

Number types-integer = INT-for integers.

include

using namespace std;

int main ().
{

int all = 13; / / All (whole number)

return 0;
}
Number types-float-for fractional numbers.

include

using namespace std;

int main ().
{

int mn = 13.15; / / real (whole number

return 0;
}
for double-fractional numbers.

For example:

include

using namespcace std;

Top comments (0)